Quote:
|
Originally Posted by jsharon1248
First thing is to confirm the culprit, the ADO.NET transaction or the stored proc. Run the stored proc through the DB2 CLP and see if you experience the same behavior. Make sure you turn auto-commit off. (update command options using c off). Looking at the stored proc, I'm thinking that the problem is in the ADO.NET transaction, not the stored proc.
|
Ok, here is what I have tried:
created the store proc
drop procedure MFLLPGM.DANITS2;
CREATE PROCEDURE MFLLPGM.DANITS2 (
IN branchcode VARCHAR(7) ,
IN surrogate CHAR(7)
)
LANGUAGE SQL
MODIFIES SQL DATA
BEGIN
INSERT INTO ...........;
END ;
and then created another stored proc that calls this sp on a transaction.
drop procedure MFLLPGM.DANITS5;
CREATE PROCEDURE MFLLPGM.DANITS5 (
IN branchcode VARCHAR(7) ,
IN surrogate CHAR(7)
)
LANGUAGE SQL
MODIFIES SQL DATA
BEGIN
SET TRANSACTION ISOLATION LEVEL RR;
call MFLLPGM.DANITS2(branchcode, surrogate);
ROLLBACK;
END ;
and then called it
call MFLLPGM.DANITS5('0000', '000');
The rollback worked like a charm, so it obviously does the job. However, it only does it if I leave the SET TRANSACTION ISOLATION LEVEL RR in.
How can I check what the transaction isolation level is when I call it from my client code?
Is there anything I need to add to the connection string or to the stored proc so that it keeps the isolation level initialized in the client?
Surely this should work, otherwise it wouldn't be available in the iseries provider, and it is also stated in the iseries provider book. Please let me know what you think, any idea is appreciated.
Cheers,
Dan