This content has been marked as final.
Show 3 replies
-
1. Re: Concurrency in Transactions
bill.burke Nov 21, 2005 3:42 PM (in response to lipido)optimistic locking maybe your solution. Try adding a @Version field to your Studient entity class. Then client2 will be aborted.
You would have to use the Hibernate APIs to perform a pessimistic lock. -
2. Re: Concurrency in Transactions
lipido Nov 21, 2005 4:55 PM (in response to lipido)So, Do I have to use @Version in all Entities? Is there a performance/other kind of problem/drawback doing that?
-
3. Re: Concurrency in Transactions
epbernard Nov 25, 2005 4:42 AM (in response to lipido)The behavior you i've got is known as the secfond lost update issue.
To solve that:
- use repeteable read for your JDBC tx isolation level
- or use read_commited + optimistic locking (ie @Version)
@Version as no known drawbacks nor perf cost if you can afford adding a version column in your relational model