Bug 1058875

Summary: Expose plain query in "query-name" attribute of "query-cache" nodes
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Thomas Segismont <tsegismo>
Component: JPAAssignee: Scott Marlow <scott.marlow>
Status: CLOSED NOTABUG QA Contact: Zbyněk Roubalík <zroubali>
Severity: high Docs Contact: Russell Dickenson <rdickens>
Priority: unspecified    
Version: 6.2.1CC: jdoyle, msimka, smarlow
Target Milestone: ---   
Target Release: EAP 6.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-29 14:47:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1040733    
Bug Blocks:    

Description Thomas Segismont 2014-01-28 16:53:44 UTC
Description of problem:
"query-name" attribute of "query-cache" nodes exposes an "encoded" query string

Version-Release number of selected component (if applicable):
All released versions of EAP6

How reproducible:
Always

Steps to Reproduce:
1.Deploy an application based on JPA/Hibernate
2.Inspect deployment/subsystem/jpa/hibernate-persistence-unit/query-cache nodes

Actual results:
"query-name" has an encoded value, like:
SELECT_space_m_space_FROM_space_Message_space_m

Expected results:
"query-name" shows the plain query:
SELECT m FROM Message m 

Additional info:
This is a request to backport JIPI-29 fix into EAP6.3
See https://issues.jboss.org/browse/JIPI-29

Comment 1 Scott Marlow 2014-01-28 19:38:30 UTC
I just built the EAP 6.2.x branch locally and can see that we already have the desired query-name attribute.  In WildFly 8, query-name was set incorrectly but that is now fixed as part of JIPI-29.:

{quote}
pwd 

/deployment=jmxp.ear.ear/subdeployment=jmxp.ejb.jar/subsystem=jpa/hibernate-persistence-unit=jmxp.ear.ear/jmxp.ejb.jar#fraudPU/query-cache=SELECT_space_m_space_FROM_space_Message_space_m

ls
query-cache-hit-count=0             query-cache-put-count=0             query-execution-count=2             query-execution-min-time=2          query-name=SELECT m FROM Message m  
query-cache-miss-count=0            query-execution-average-time=6      query-execution-max-time=10         query-execution-row-count=0     
{quote}

Also:

{quote}
pwd 

/deployment=jmxp.ear.ear/subdeployment=jmxp.ejb.jar/subsystem=jpa/hibernate-persistence-unit=jmxp.ear.ear/jmxp.ejb.jar#fraudPU/query-cache=SELECT_space_m_space_FROM_space_Message_space_m_space_where_space_m.reliable_space__equal__space__quote_y_quote_

ls

 ls
query-cache-hit-count=0                                    query-execution-average-time=1                             query-execution-min-time=1                                 
query-cache-miss-count=0                                   query-execution-count=2                                    query-execution-row-count=0                                
query-cache-put-count=0                                    query-execution-max-time=1                                 query-name=SELECT m FROM Message m where m.reliable = 'y'  

{quote}

Comment 2 Scott Marlow 2014-01-29 14:02:39 UTC
How do you mark this bugzilla as already fixed by bz-1040733?

Comment 3 Thomas Segismont 2014-01-29 14:47:10 UTC
I'll close it as not a bug because:
* the purpose of this bug was to get the fix for JIPI-29 backported into EAP6.3
* it appeared since that only Wildfly was broken and EAP6 shows the plain query in the "query-name" attribute