This can be done in two ways:
1. Explicitly throwing the bpelx:rollbackFault
< throw name="Throw_1" faultName="bpelx:rollback"/>
we can throw the rollback fault which will result in to the rollback of all activities part of the rolled back transaction.
In this case disadvantage is we will not be able to send any response back to the client and
this instance will come as faulted instance in em console.
So best way is executing SQL statement containing the rollback statement.
This will look like following
BEGIN
rollback;
END;
Now once the error is caught you can explicitly execute this SQL statement cause the rollback of statements executed on a particular database. So if there are multiple databases, you will have to multiple such SQL statements needed.
Advantage: Advantage of this approach is that your BPEL instance still remains there and u can easily see what has actually happened and all the database statements executed also gets roll backed and you can send to reponse to the client.
No comments:
Post a Comment