-
1. Re: JBoss cache / WebLogic: problem with suspend/resume tran
brian.stansberry Oct 29, 2009 8:33 PM (in response to adam.laczynski)JBoss Cache doesn't suspend/resume the transaction; it's Hibernate's integration with JBC that does this. If JBC sees an active transaction it will hold a lock on data in the cache until that tx commits. There are times when it's incorrect for those locks to be held for that long, so Hibernate suspends the tx before calling into JBC.
To avoid these suspensions you should:
1) Not use query caching, since the suspensions are very common with query caching operations.
2) Avoid bulk operations (executing SQL or HQL that modifies multiple entities) since that results in cache-clearing operations that involve suspending any active tx.
3) For the same reason, avoid the org.hibernate.SessionFactory evict* methods and the org.hibernate.Cache evict* methods. -
2. Re: JBoss cache / WebLogic: problem with suspend/resume tran
adam.laczynski Oct 30, 2009 7:46 AM (in response to adam.laczynski)"bstansberry@jboss.com" wrote:
JBoss Cache doesn't suspend/resume the transaction; it's Hibernate's integration with JBC that does this. If JBC sees an active transaction it will hold a lock on data in the cache until that tx commits. There are times when it's incorrect for those locks to be held for that long, so Hibernate suspends the tx before calling into JBC.
Suspend/resume is invoked from org.jboss.cache.interceptors.InvocationContextInterceptor#handleAll while optionOverride.isFailSilently() returns true. It comes from org.jboss.cache.invocation.CacheInvocationDelegate#putForExternalRead.
Maybe you meant that suspent/resume is invoked by Hibernate which invoked JBC methods with appropriate parameters.
As regards your suggestions:
1) I don't use query cache
2) Problem occures in read only transaction
3) Any evict on org.hibernate.SesssionFactory and org.hibernate.cache.CacheConcurrencyStrategy -
3. Re: JBoss cache / WebLogic: problem with suspend/resume tran
brian.stansberry Nov 1, 2009 9:09 PM (in response to adam.laczynski)Ah, you're right; JBC internally implements putForExternalRead with a tx suspend, because the semantic of that operation is to not hold locks beyond the scope of the method call.
Sorry, I don't see any workaround to this problem. The putForExternalRead call is fundamental to how Hibernate stores data read from the db in the cache. :( -
4. Re: JBoss cache / WebLogic: problem with suspend/resume tran
adam.laczynski Nov 2, 2009 4:22 AM (in response to adam.laczynski)Thank you for answer.