GeeCON Prague 2014*
The moose likes JDBC and the fly likes JT400 and commitment control Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "JT400 and commitment control" Watch "JT400 and commitment control" New topic
Author

JT400 and commitment control

Venkat Sadasivam
Ranch Hand

Joined: May 10, 2008
Posts: 139
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.


“Any fool can write code that a computer can understand. Good programmers write code that humans can understand. ”<br>
-Martin Fowler
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

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

Joined: Apr 29, 2008
Posts: 234
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

Joined: Oct 13, 2005
Posts: 39045
    
  23
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.
 
GeeCON Prague 2014
 
subject: JT400 and commitment control