Bug 1262401 - [GSS](6.4.z) Persistence unit not shown in management console when custom region_prefix is specified
Summary: [GSS](6.4.z) Persistence unit not shown in management console when custom reg...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: JPA
Version: 6.3.0
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: CR1
: EAP 6.4.8
Assignee: Ryan Emerson
QA Contact: Martin Simka
URL:
Whiteboard:
Depends On:
Blocks: 1273382 eap648-payload
TreeView+ depends on / blocked
 
Reported: 2015-09-11 14:28 UTC by Patrick
Modified: 2020-12-11 11:54 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-17 12:34:38 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker AS7-4441 0 Minor Closed JPA hibernate.cache.region_prefix property fails JConsole to connect to JBoss 2020-01-02 15:19:32 UTC
Red Hat Issue Tracker WFLY-5478 0 Major Closed allow custom scoped persistence unit name hint in persistence unit definition 2020-01-02 15:19:32 UTC

Description Patrick 2015-09-11 14:28:47 UTC
Description of problem:

Whenever the customer is adding size properties of infinispan second level cache,  in his persistence-unit, it ends up not being discovered in JON.

BZ1239024 was open against JON, but  concluded that the issue was in EAP.





Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. deploy hibernate4 from quickstart : jboss-eap-6.3.0-quickstarts.zip  
2 .Notice the PU is there
3. Add the following properties in persistence.xml


==============================================================================
<property name="hibernate.cache.region_prefix" value="database_cache_postgres_webtng"/>
  

			<!-- Dimensionamento circa ad 1GB di heap necessario per il numero totale di oggetti riportato  -->
			<property name="hibernate.cache.infinispan.database_cache_postgres_webtng.wp_core.eviction.max_entries" value="22969" />
			<property name="hibernate.cache.infinispan.database_cache_postgres_webtng.wp_misc.eviction.max_entries" value="66605" />
			<property name="hibernate.cache.infinispan.database_cache_postgres_webtng.wp_binary.eviction.max_entries" value="232" />
			<property name="hibernate.cache.infinispan.database_cache_postgres_webtng.wp_readonly.eviction.max_entries" value="2832" />
			<property name="hibernate.cache.infinispan.database_cache_postgres_webtng.wp_eden.eviction.max_entries" value="5726" />
			<property name="hibernate.cache.infinispan.database_cache_postgres_webtng.wp_wms.eviction.max_entries" value="358534" />
			<property name="hibernate.cache.infinispan.database_cache_postgres_webtng.wp_wms_query.eviction.max_entries" value="26221" />

			<!-- Valori espressi in millisecondi: 5min = 300000; 15 min = 900000; 1 h = 3600000 -->
			<property name="hibernate.cache.infinispan.database_cache_postgres_webtng.wp_readonly.expiration.lifespan" value="900000" />
			<property name="hibernate.cache.infinispan.database_cache_postgres_webtng.wp_core.expiration.lifespan" value="900000" />
			<property name="hibernate.cache.infinispan.database_cache_postgres_webtng.wp_misc.expiration.lifespan" value="900000" />
			<property name="hibernate.cache.infinispan.database_cache_postgres_webtng.wp_binary.expiration.lifespan" value="900000" />
			<property name="hibernate.cache.infinispan.database_cache_postgres_webtng.wp_eden.expiration.lifespan" value="900000" />
			<property name="hibernate.cache.infinispan.database_cache_postgres_webtng.wp_wms.expiration.lifespan" value="900000" />
			<property name="hibernate.cache.infinispan.database_cache_postgres_webtng.wp_wms_query.expiration.lifespan" value="900000" />

			<property name="hibernate.cache.infinispan.database_cache_postgres_webtng.wp_readonly.expiration.max_idle" value="900000" />
			<property name="hibernate.cache.infinispan.database_cache_postgres_webtng.wp_core.expiration.max_idle" value="900000" />
			<property name="hibernate.cache.infinispan.database_cache_postgres_webtng.wp_misc.expiration.max_idle" value="900000" />
			<property name="hibernate.cache.infinispan.database_cache_postgres_webtng.wp_binary.expiration.max_idle" value="900000" />
			<property name="hibernate.cache.infinispan.database_cache_postgres_webtng.wp_eden.expiration.max_idle" value="900000" />
			<property name="hibernate.cache.infinispan.database_cache_postgres_webtng.wp_wms.expiration.max_idle" value="900000" />
			<property name="hibernate.cache.infinispan.database_cache_postgres_webtng.wp_wms_query.expiration.max_idle" value="900000" />
==============================================================================

4. Redeploy the app
5. Notice the PU is no longer available


Actual results:

The PU is not  available

Expected results:

The PU should be available

Additional info:

Comment 2 Patrick 2015-10-01 15:07:13 UTC
Hello,

Apologies for the delay:

I tried myself,and the issue is still there, later on, Dave++ found out that the App  doesn't sent PU information on purpose, when  region_prefix is  property is used.


https://issues.jboss.org/browse/AS7-4441

This is a code snippet from org.jboss.as.jpa.processor.PersistenceUnitServiceHandler

private static void addManagementConsole(final DeploymentUnit deploymentUnit, final PersistenceUnitMetadata pu,
                                      final PersistenceProviderAdaptor adaptor) {
      ManagementAdaptor managementAdaptor = adaptor.getManagementAdaptor();
      // workaround for AS7-4441, if a custom hibernate.cache.region_prefix is specified, don't show the persistence
      // unit in management console.
      if (managementAdaptor != null &&
              adaptor.doesScopedPersistenceUnitNameIdentifyCacheRegionName(pu)) {



That issue seems to be solved and it's about jmx-console, but the same behaviour is still happening, as test on EAP-6.3.0 and JON-3.3.0
The PU wont show up in EAP  and JON . Only by setting these:


         <property name="hibernate.cache.use_second_level_cache" value="true"/>
         <property name="hibernate.cache.region_prefix" value="myprefix"/>         
          <property name="hibernate.cache.infinispan.myprefix.MyEntity.cfg"   value="MyEntity-Cache"/>  
          <property name="hibernate.cache.infinispan.myprefix.MyEntity.expiration.max_idle" value= "65123"/>
        
         <property name="hibernate.cache.infinispan.myprefix.MyEntity.eviction.max_entries" value= "10000"/>
		<property name="hibernate.cache.infinispan.myprefix.MyEntity.expiration.lifespan" value= "50000"/>
		<property name="hibernate.cache.infinispan.myprefix.MyEntity.expiration.max_idle" value= "50000"/>


according to this kcs:
https://access.redhat.com/solutions/440683


Although, the PU is deployed correctly, and works as expected.


Cheers

Comment 5 JBoss JIRA Server 2015-10-20 12:50:09 UTC
Scott Marlow <scott.marlow> updated the status of jira WFLY-5478 to Closed

Comment 7 Mike McCune 2016-03-28 23:25:37 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 14 Michael Cada 2016-05-10 08:17:09 UTC
Verified with EAP 6.4.8.CP.CR2

If you use hibernate.cache.region_prefix you also have to set jboss.as.jpa.scopedname on the same value.

Comment 15 Petr Penicka 2017-01-17 12:34:38 UTC
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.


Note You need to log in before you can comment on or make changes to this bug.