aspose file tools*
The moose likes JDBC 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
Bookmark "How does jdbc handles concurrency?" Watch "How does jdbc handles concurrency?" New topic
Author

How does jdbc handles concurrency?

Lorus Ghut
Greenhorn

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
Greenhorn

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.

Type_Forward_Only/Concur_Read_Only
(pretty much static) retrieved and displayed with Navigation forward.
Type_Scroll_Insensitive/Concur_Read_Only
(pretty much static) retrieved and displayed with Navigation bothside.
Type_Scroll_Sensitive/Concur_Read_Only
(Changes reflected if SUB-SET is changed by Others,Navigation bothside.
-----------------------------------
Type_Forward_only/Concur_Updateable
Type_Scroll_Insensitive/Concur_Updateable
Type_Scroll_Sensitive/Concur_Updateable
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.
SQL:
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.
 
 
subject: How does jdbc handles concurrency?