This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes JT400 and commitment control Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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
Sheriff

Joined: Oct 14, 2005
Posts: 19691
    
  10

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: 43350
    
  32
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.
 
Don't get me started about those stupid light bulbs.
 
subject: JT400 and commitment control
 
It's not a secret anymore!