I see what you are saying.  It's my understanding that regardless of the cache, a 
findByPrimaryKey() will always hit the database.

I think that the reason for this is that a findByPrimaryKey() will return a handle, 
but not necessarily load the object; that happens when a method is invoked upon that 
object.

If you wanted to do a test to see if you could populate the entity cache with the 
Author and Editor entities, just try invoking one of their CMP accessor methods.  I 
think that would do it.  However, I don't think that will help you in preventing db 
accesses in your entity findByPrimaryKey() methods.

I'd be interested in learning how to avoid this as well.



<a 
href="http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3826860#3826860";>View 
the original post</a>

<a 
href="http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3826860>Reply 
to the post</a>


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to