cancel
Showing results for 
Search instead for 
Did you mean: 

Transaction in JDBC Adapter

Former Member
0 Kudos

Hi Guru.

I have a question for you:

I have need to write more line in a SQLServer 2k table with a unique ID.

For each line I need to call a store procedure with the ID like a input parameter.

When a store procedure raises an error I need to rollback all the sotre procedures called, now I the DB rollback only the store procedure with error.

Now the MT is like this:

MT_SELECT

---SelectTable (0..unbounded)

-


MV101M (0..1)

-


action (opt)

-


access (0..1)

-


ID

-


...

-


key (0..1)

-


ID

<b>---Procedure (0..Unbounded)

-


WS_INPORT (0..1)

-


action

-


table

-


ID

-


...</b>

How can I rollback all the transaction of the store procedures (if possible) with XI?

Thanks

Manuel

Message was edited by:

Manuel Chiarelli

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Write your procedure in SQL. Then, you can call it throw your XML like it's explained here (StatementName5):

http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Manuel !

As far as I know, rollback is not possible as a built-in feature in JDBC via XI.

You can for example, wrap all the stored procedures calls in another stored procedure to control the transactional execution or trigger a rollback from inside that wrapper stored procedure.

Another way, could be to develop a reverse stored procedure that "rolls back" what was created by the original stored procedures just in case the transaction had an error. Then via BPM, you could create a workflow to check the result of the first execution, if anything goes wrong, then you could execute the reverse stored procedure to undo what the first execution did.

Regards,

Matias.