POSTS CATEGORIES

Translate

Showing posts with label SOA 11g. Show all posts
Showing posts with label SOA 11g. Show all posts

ORA-02089 – COMMIT is not allowed

When calling a stored procedure from SOA Suite 11g (Bpel/OSB/BPM ….) , you might get the following error:
….
java.sql.SQLSyntaxErrorException: ORA-02089: COMMIT is not allowed in a subordinate session
….

The reason for that error(you can use one of them):
You have defined a data source base on Global Transaction (XA)
In a Global Transaction, the ‘Two-Phase Commit’ protocol for global transaction processing is automatically being selected. It means that the Weblogic server is responsible to complete all of the transactions (or non of them).
In short – adding a COMMIT to your code (being invoked) is not allowed.
There are few ways to solve this error:
  1. Change the data source to use Non-XA
    (and check  the “Supports Global Transactions” & “Emulate Two-Phase Commit” buttons)
  2. Delete the COMMIT from your code.
  3. Use the “PRAGMA AUTONOMOUS_TRANSACTION“. This will kind of create a separate transaction that will allow to use a commit.For example:CREATE PROCEDURE XXX AS
    PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN …