Bug 1262401 - [GSS](6.4.z) Persistence unit not shown in management console when custom region_prefix is specified [NEEDINFO]
[GSS](6.4.z) Persistence unit not shown in management console when custom reg...
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: JPA (Show other bugs)
x86_64 Linux
unspecified Severity high
: CR1
: EAP 6.4.8
Assigned To: Ryan Emerson
Martin Simka
Depends On:
Blocks: 1273382 eap648-payload
  Show dependency treegraph
Reported: 2015-09-11 10:28 EDT by Patrick
Modified: 2017-01-17 07:34 EST (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2017-01-17 07:34:38 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
remerson: needinfo? (bmaxwell)

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker AS7-4441 Minor Closed JPA hibernate.cache.region_prefix property fails JConsole to connect to JBoss 2017-10-27 13:22 EDT
JBoss Issue Tracker WFLY-5478 Major Closed allow custom scoped persistence unit name hint in persistence unit definition 2017-10-27 13:22 EDT

  None (edit)
Description Patrick 2015-09-11 10:28:47 EDT
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 11:07:13 EDT

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.


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:

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

Comment 5 JBoss JIRA Server 2015-10-20 08:50:09 EDT
Scott Marlow <scott.marlow@redhat.com> updated the status of jira WFLY-5478 to Closed
Comment 7 Mike McCune 2016-03-28 19:25:37 EDT
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune@redhat.com with any questions
Comment 14 Michael Cada 2016-05-10 04:17:09 EDT
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 07:34:38 EST
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.