Reputation: 99
Is it possible to get the functionality of autonomous stored procedure in DB2 z/OS 10?
Scenario is: attempt to execute given stored procedure must logged to our logs table even if the procedure ended with exception (rollback was performed).
I was going to use autonomous stored procedure for that, but in z/OS it was introduced in version 11...
Please note that I am not able to change the database setup, unless it's absolutely necessary. If you worked with years-old mainframe monstrosities, you understand.
Upvotes: 0
Views: 317
Reputation: 7693
You could simulate (Actually, this is the way autonomous SPs works in LUW) the autonomous option by calling an external stored procedure (in C or Java) that creates another connection to the database and call the "autonomous" SP.
By recreating the connection from an external SP, you will have the isolated environment to execute the "autonomous" part.
I wrote an article in my blog about autonomous SP in LUW: http://angocadb2.blogspot.com/2014/05/autonomous-transactions.html
Upvotes: 2