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 Can isolation level 'serial' produce the same protection as the 'synchronized' keyword? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Can isolation level Watch "Can isolation level New topic
Author

Can isolation level 'serial' produce the same protection as the 'synchronized' keyword?

Jef Smith
Greenhorn

Joined: Jul 28, 2011
Posts: 14
I'm working on a Java course registration app that contains the following code:


course.getNumberOfOpenings() runs a query to get the number of openings so this situation seems to call for a synchronize block to prevent a swap out of the thread after the number of openings check but before the actual registration but there is no synchronization code of any kind.

However, immediately before this block is executed the isolation level of the JDBC connection is set to 'serial'. Does this isolation level provide the equivalent protection of a synchronized block in this case?

Thanks for any insight into this,
JefS
 
wood burning stoves
 
subject: Can isolation level 'serial' produce the same protection as the 'synchronized' keyword?