This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes JDBC and Relational Databases 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 Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Can isolation level 'serial' produce the same protection as the 'synchronized' keyword?
 
It's not a secret anymore!