-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: concurrency issues ...
PostPosted: Thu Oct 05, 2006 2:29 am 
Newbie

Joined: Sun Sep 03, 2006 1:21 am
Posts: 9
i use Hibernate 3 with CMT[container managed transaction] on jboss 4.

- if session flushmode is set to FlushMode.COMMIT, then it appears more efficient and there are much less concurrency related exceptions than the default FlushMode.AUTO.
But are there consequences of not using FlushMode.AUTO with CMT? can data be corrupted?

- lost update problem happens with isolation level READ_COMMITTED. Hibernate uses optimistic versioning which should solve the problem. But what about the lost update problem on the version number itself? Transaction 1 reads version number, then transaction B reads version number and updates the row data and version number, so now transaction 1 has wrong version number but it still commits anyway? Does Hibernate get a row read lock[other transactions cannot update] when it reads the version number? If yes, then it appears no advantage of using READ_COMMITTED because read lock is equivalent to isolation level REPEATABLE_READ?

- The problem "AbstractFlushingEventListener Could not synchronize database .." happens very often. It is apparently a concurrency related problem. What is the cause and how to avoid this?


Top
 Profile  
 
 Post subject: Versioning
PostPosted: Mon Oct 30, 2006 5:22 am 
Newbie

Joined: Sun Oct 29, 2006 2:27 pm
Posts: 5
I'll just try to answer the second question. From what I understand, the second transaction will not be able to execute the update, because, with managed versioning, the update clause includes a where condition - WHERE version = <version read by the transaction>. If the version was incremented by another transaction in the meantime, the where will not be matched, and the second update will not succeed. This will return 0 as the number of updated rows, which will cause Hibernate to throw a stale data exception.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.