Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How does jdbc handles concurrency?

 
Lorus Ghut
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic