[jboss-user] [Performance Tuning] - Why findByPrimaryKey issues ?SELECT pkey from TABLE where p

Anbuselvan do-not-reply at jboss.com
Tue Nov 7 13:19:54 EST 2006


We use jboss-4.0.0 in 2 node cluster configuration with  ?Standard CMP 2.x EntityBean with cache invalidation?, commit option A.

Whenever our application invokes ?findByPrimaryKey? on CMPs, JBOSS issues ?SELECT  pkey from TABLE where pkey=??. This ?SELECT? makes sense when entity is loaded for first time, I am not sure why ?findByPrimaryKey? issues  ?SELECT  pkey from TABLE where pkey=?? on subsequent request for the same entity(for same primary key) instead of getting it from cache.

We are trying to optimize DB access by cutting down on the number of ?SELECT? queries issued. 

Is it possible to avoid the ?SELECT? issued by findByPrimaryKey on subsequent invocation on already loaded entity?  If yes, please provide me some pointers on how to do this.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983872#3983872

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983872



More information about the jboss-user mailing list