I thought that the latest version of hibernate has a default of lazy 
instantiation whereas the prior version defaulted to non-lazy. The hibernate 
mappings that come with jBPM in many cases used the default.

I think that you need to be careful regarding when you use lazy or not. For 
example, if you use lazy and you close the JbpmSession, any reference to the 
lazily instantiated referenced object will not be resolvable because the 
hibernate session will not be available to resolve the reference. Lazy 
references perform better until you need the reference, then one by one as you 
call the getter, the query is executed.

As far as the earlier post that referred to enabling cache for the collections, 
here is an example.

    <set name="taskInstances" cascade="all" inverse="true" lazy="false"  
batch-size="25">
  |       <cache usage="nonstrict-read-write"/>
  |       <key column="TASKMGMTINSTANCE_"/>
  |       <one-to-many class="org.jbpm.taskmgmt.exe.TaskInstance" />
  |     </set>

Somthing else to consider...similar to EJB entity beans, where they provide 
many positive features for transactional processing, a hibernate based approach 
may not be the best choice for query processing. If your application provides 
lists of summary data of entities from which the user selects an item to drill 
down on the details and/or update, you might consider bypassing hibernate to 
build the list or define a database view, some new classes and hibernate 
mappings that provide a lightweight read-only list.

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

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


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to