• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

When is exclusive lock released

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a J2EE app which connects to DB2.
In one method, I have a Stored procedure call which has INSERT SQL.

I DON'T have any transaction mgmt in my application. In this case, when does the exclusive lock gets released?


Thanks,
Gokul
 
gokul maha
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I dont have any commit statement in Stored procedure also.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you using auto-commit? If so, as soon as the stored procedure is done processing.

In general, changes are made permanent and locks released once a commit is done, whether an autocommit (as soon as the statement/procedure is done) or a manual commit (your code making the commit call, or JPA/Hibernate/other-db-framework making the commit call).
 
gokul maha
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Am not using auto-commit in my code.
By default in DB2, auto-commit is set to TRUE right?
Can this be configured in the application server datasource settings?
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

gokul maha wrote:By default in DB2, auto-commit is set to TRUE right?


I don't know about DB2, but for most databases auto-commit is true be default.

Can this be configured in the application server datasource settings?


Yes. See your app server docs for how to.
 
gokul maha
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the info Peter.
 
reply
    Bookmark Topic Watch Topic
  • New Topic