views:

620

answers:

3

I am trying to write a client which executes a series of DB2 iSeries Stored procedures in DB2. I am using the IBM.Data.DB2.iSeries provider and need all my calls to be within a .NET transaction. Seems like everything is ignored and data being committed.Any pointers...

+3  A: 

Is the database on the iSeries journaled? That's required for commitment control.

Brandon Peterson
yes the required files in question are journaled
chugh97
Is your iSeries server under software maintenance? If so you can probably call IBM and ask them directly.
Brandon Peterson
Also it might be helpful to know how those stored procedures are defined or used. Are you using the SQL CALL statement, are they RPG programs, etc.
Brandon Peterson
BTW stored procedures can be defined to auto-commit when they are used. See the second to last paragraph at http://www.itjungle.com/fhg/fhg061604-story01.html.
Brandon Peterson
A: 

Are you using the DB2Connection.BeginTransaction Method?

Paul Morgan
A: 

I just had this same issue, and figured out that the problem is not in the .Net code, but in the stored procedure. Check your stored proc definition for a COMMIT option. If it is set to "*NONE" it will auto-commit, regardless of transactions in your .Net code. Change it to *RR (repeatable read), and your transactions should work correctly.

More information here.

AJ