[jboss-jira] [JBoss JIRA] (WFLY-5478) allow custom scoped persistence unit name hint in persistence unit definition

Scott Marlow (JIRA) issues at jboss.org
Tue Oct 6 15:28:00 EDT 2015


    [ https://issues.jboss.org/browse/WFLY-5478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13115657#comment-13115657 ] 

Scott Marlow commented on WFLY-5478:
------------------------------------

Example output with a quick start deployment that contains persistence unit definition:
{quote}
<persistence version="2.1"
   xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="
        http://xmlns.jcp.org/xml/ns/persistence
        http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
   <persistence-unit name="primary">
      <!-- If you are running in a production environment, add a managed
         data source, this example data source is just for devleopment and testing! -->
      <!-- The datasource is deployed as WEB-INF/hibernate4-quickstart-ds.xml, you
         can find it in the source at src/main/webapp/WEB-INF/hibernate4-quickstart-ds.xml -->
      <jta-data-source>java:jboss/datasources/Hibernate4QuickstartDS</jta-data-source>
      <properties>
         <!-- Properties for Hibernate -->
         <property name="hibernate.hbm2ddl.auto" value="create-drop" />
         <property name="hibernate.show_sql" value="false" />
         <property name="jboss.as.jpa.scopedname" value="hibernatequickstart#primary"/>
      </properties>
   </persistence-unit>
</persistence>
{quote}

Output from pwd command in cli:
{quote}
pwd
/deployment=wildfly-hibernate4.war/subsystem=jpa/hibernate-persistence-unit=hibernatequickstart#primary
{quote}

Output from ls command in cli:
{quote}
ls
collection                                                                                                                                                                                                                                                        
entity                                                                                                                                                                                                                                                            
entity-cache                                                                                                                                                                                                                                                      
query-cache                                                                                                                                                                                                                                                       
close-statement-count=0                                                                                                                                                                                                                                           
collection-fetch-count=0                                                                                                                                                                                                                                          
collection-load-count=0                                                                                                                                                                                                                                           
collection-recreated-count=0                                                                                                                                                                                                                                      
collection-remove-count=0                                                                                                                                                                                                                                         
collection-update-count=0                                                                                                                                                                                                                                         
completed-transaction-count=1                                                                                                                                                                                                                                     
connect-count=3                                                                                                                                                                                                                                                   
enabled=true                                                                                                                                                                                                                                                      
entity-delete-count=0                                                                                                                                                                                                                                             
entity-fetch-count=0                                                                                                                                                                                                                                              
entity-insert-count=1                                                                                                                                                                                                                                             
entity-load-count=6                                                                                                                                                                                                                                               
entity-update-count=0                                                                                                                                                                                                                                             
flush-count=2                                                                                                                                                                                                                                                     
hibernate-persistence-unit=hibernatequickstart#primary                                                                                                                                                                                                            
optimistic-failure-count=0                                                                                                                                                                                                                                        
prepared-statement-count=3                                                                                                                                                                                                                                        
query-cache-hit-count=0                                                                                                                                                                                                                                           
query-cache-miss-count=0                                                                                                                                                                                                                                          
query-cache-put-count=0                                                                                                                                                                                                                                           
query-execution-count=2                                                                                                                                                                                                                                           
query-execution-max-time=1                                                                                                                                                                                                                                        
query-execution-max-time-query-string=[CRITERIA] select this_.id as id1_0_0_, this_.address as address2_0_0_, this_.email as email3_0_0_, this_.name as name4_0_0_, this_.phone_number as phone_nu5_0_0_ from MemberHibernate4Demo this_ order by this_.name asc  
scoped-unit-name=hibernatequickstart#primary                                                                                                                                                                                                                      
second-level-cache-hit-count=0                                                                                                                                                                                                                                    
second-level-cache-miss-count=0                                                                                                                                                                                                                                   
second-level-cache-put-count=0                                                                                                                                                                                                                                    
session-close-count=2                                                                                                                                                                                                                                             
session-open-count=2                                                                                                                                                                                                                                              
statistics-enabled=true                                                                                                                                                                                                                                           
successful-transaction-count=1                                                                                                                                                                                      {quote}

> allow custom scoped persistence unit name hint in persistence unit definition
> -----------------------------------------------------------------------------
>
>                 Key: WFLY-5478
>                 URL: https://issues.jboss.org/browse/WFLY-5478
>             Project: WildFly
>          Issue Type: Feature Request
>          Components: JPA / Hibernate
>    Affects Versions: JBoss AS7 7.1.1.Final, 8.0.0.Final, 9.0.0.Final, 10.0.0.CR2
>            Reporter: Scott Marlow
>            Assignee: Scott Marlow
>
> Consider allowing applications to override the scoped persistence unit name, so instead of using names like "test2.ear/w2.war#warPUnit_PU", the application can specify a unique (across all deployments on the app server) name.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list