[jboss-user] [JBoss jBPM] - Re: ProcessDefinition in 2nd level cache
a.grin
do-not-reply at jboss.com
Thu Apr 26 12:12:12 EDT 2007
Hi Roland,
Read-only data doesn't mean read-only Session instance. Session caches all read data internally (1st level cache), so each select may change its state. I'm not sure if it applies for the objects that are cached also in the 2nd level cache but in any case I would follow the recommendation in the Hibernate documentation not to use one session from several threads because there is no guarantee that if this concurrent access works now without problems (and I don't expect it does) it will be also working with the future versions.
Besides, usually you do not access process definition directly. You start from process instance. In my case even from another object that contains process instance. And process definition (there can be of course many of them) will be transparently loaded from the session that loaded my main object. And it is also kind of problematic to keep all these sessions open. Having used Hibernate intensively in the last 3 years I believe that the objects with lazy loading in the 2nd level cache is a problem. At least I have no idea how to deal with it. Maybe someone from jbpm development can explain what usage scenario they had in mind.
Thanks. Andrey.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4041074#4041074
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4041074
More information about the jboss-user
mailing list