[jboss-user] [Clustering/JBoss] - Best locking strategy

bentins do-not-reply at jboss.com
Thu Dec 4 07:10:23 EST 2008


I have an existing ejb 2.1 application which I now moved to clustering.

If I understand the documentation correctly 2.1 entities are not shared on the cluster through a common cache. 

This means that if two users running on two different nodes are working on the same database row through an entity bean they may corrupt the data?

If so, I tried to use row-locking on the entity which creates a "SELECT FOR UPDATE... " queries on the db and thus locks the row when a transaction is working on it. But with this I have problems on ejb queries that use "DISTINCT, MAX, MIN or SUM" and since I have such queries it does not look like a good solution.

Can someone please help here on what is the best strategy? Should I try to use optimistic locking on all beans? Did I understand the documentation wrong?

THX

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

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



More information about the jboss-user mailing list