I'm trying to optimize db usage using read-ahead and optimize pessimistic locking 
using read-ahead beans, but these seem to be mutually exclusive, since the read-ahead 
beans and read-ahead methods don't participate in transactions so never use a pre-load 
cache.

For example, using JBoss 3.2.4RC1, with no read-ahead, I run a finder and then 
separately load each entity bean, generating N+1 db calls.  I can remove these 
unneeded calls by adding read-ahead (either on-find or on-load), but then when I add 
read-only using either:

<read-only>
OR
<method-attributes>
  
    <method-name>get*</method-name>
    <read-only>true</read-only>
  
</method-attributes>

then I'm back to N+1 because the read-only methods don't particpate in the transaction 
so don't use the precached data.

Is there any way to address both of these issues without turning to optimistic 
locking?  It seems like theoretically a read-only method accessed from a transaction 
could still be able to access the data in the preload cache without locking the bean...

dave

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

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


-------------------------------------------------------
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