File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes How does jdbc handles concurrency? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "How does jdbc handles concurrency?" Watch "How does jdbc handles concurrency?" New topic

How does jdbc handles concurrency?

Lorus Ghut

Joined: Jul 31, 2002
Posts: 28
I am building a web application, and I am using JDBC to work with a database.
I wonder how JDBC handles concurrent updates etc. to a database.
Could anoywone briefly describe this to me?
vishwas bansal

Joined: Dec 19, 2002
Posts: 6
A default ResultSet object is not updatable .
following combinations for ResultSet Object's concurrency control are possible.
You can always chuckup Type-Forward_Only combinations those are pretty straight forward.

(pretty much static) retrieved and displayed with Navigation forward.
(pretty much static) retrieved and displayed with Navigation bothside.
(Changes reflected if SUB-SET is changed by Others,Navigation bothside.
All with Updateable attribute works in lock mode.But the result set may differ for databases.
For :Type_Scroll_Sensitive/Concur_Updateable

Oracle:The lock is obtained for the row we are updating,everybody else will see the snapshot of old row.As soon as commit takes place ,new Data will be reflected for users who are using sensitive attribute.
A)All the users trying to get same result-set may get blocked.
B)If query ran using Select(NO-LOCK) then there is a threat of getting un-commited data from others users working in updatable mode.(assumed we are in sensitive mode.)
Hope this will help.
I agree. Here's the link:
subject: How does jdbc handles concurrency?
It's not a secret anymore!