[jboss-user] [JBoss Cache: Core Edition] - Re: on child insert parent, child collection updated in DB b

dukehoops do-not-reply at jboss.com
Fri Mar 6 12:32:39 EST 2009


Brian,

I didn't understand your comment above. Were you saying that you will take my test source and adapt it to hibernate-jbc test suite or were you suggesting I do it?

I took another look at hib-jbc project but could not find any examples of tests exercising hibernate and jbc *3*. I looked here:
http://anonsvn.jboss.org/repos/hibernate/core/trunk/cache-jbosscache2/

But this project uses jbc2, meaning (AFAIK):
-using jbc2-styled config
-using optimistic or pessimistic locking (and not MVCC). 
In other words, it's not the same setup as one described above.

TransactionalAccess or OptimisticTransactionalAccess?
And that got me thinking of whether I am using correct TransactionalAccess class:

org.hibernate.cache.jbc2.access has two classes:
TransactionalAccessDelegate and OptimisticTransactionalDelegate. The latter does things like this:

        Option opt = getDataVersionOption(version, version);
        return CacheHelper.putForExternalRead(cache, regionFqn, key, value, opt);


Debugging tells me I am using TransactionalAccessDelegate. Shouldn't OptimisticTxDelegate be used since my Domain object do use Hibernate's @Version? Or is that irrelevant because the two choices translate to deprecated Optimistic or Pessimistic locking in JBC and we're using MVCC?


I also have caches configured as Srping Beans (with Configuration and RuntimeConfig also spring beans) and use org.jboss.cache.CacheFactory directly to build caches (as described in JBC3 User Guide). org.hibernate.cache.jbc2 on the other hand uses org.jboss.cache.CacheManager to do the same. The reason I went with that approach is that org.hibernate.cache.jbc2 seems to want to work of jbc2-styled treecache.xml config only and does not parse org.jboss.cache.config.Configuration





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

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



More information about the jboss-user mailing list