Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JT400 and commitment control

 
Venkat Sadasivam
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using jt400 database driver to connect to AS400 database. Using jt400 I am calling a stored procedure in AS400.

When I start commitment control in stored procedure it says commitment control is already active. Whereas I have disabled autocommit and transaction isolation from Java end.

I am looking for a solution to make commitment control work inside stored procedure.
 
Paul Clapham
Sheriff
Posts: 21316
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want a transaction inside your stored procedure, then turning off commitment control isn't the way to do that. Commitment control is simply the background process which manages transactions. So don't turn it off. (And don't turn it on, either, it should already be on for files which you are updating with that driver.)

Sorry, I don't know how to start a transaction inside your stored procedure.
 
Brij Garg
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

If you want a transaction inside your stored procedure, then turning off commitment control isn't the way to do that. Commitment control is simply the background process which manages transactions. So don't turn it off. (And don't turn it on, either, it should already be on for files which you are updating with that driver.)

This means we can not turn off the autoCommit inside stored procedure.
Is this restriction is for stored procedure only ?
 
Campbell Ritchie
Sheriff
Pie
Posts: 49756
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Writing START TRANSACTION; turns auto-commit off until the transaction is completed.
Writing COMMIT; at the end of the transaction turns auto-commit back on. As Paul has already told you, leave the auto-commit status alone.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic