File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes concurrent transactions Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "concurrent transactions" Watch "concurrent transactions" New topic
Author

concurrent transactions

Jasvir Rupana
Ranch Hand

Joined: Oct 13, 2010
Posts: 52
hello everyone,
please some one clear my following doubt in concurrent transactions situation



1. 2 users open same database row to update ,say user 1 update a field RED and after a moment other user updates it to GREEN. user 1 changes will be lost .how to handle it in simple JDBC /hibernate .

i have read isolation levels dirty reads and all therotically but coldnot find some practical soultion.

i read that hibernatea appends some uid with each row to handle this but never saw this happening.

whats the solutions guys in jdbc and hibernate ??


Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Lost updates can be prevented by implementing optimistic locking. If its Hibernate you are using, I'd first google the term, then check out its documentation on versioning.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://jrebel.com/download
 
subject: concurrent transactions
 
Similar Threads
How to Update an Entity in the concurrent transactions?
Please comment on the application design
How to update string to Oracle Clob
Dirty Read / Dirty Write scenarios
Design question