Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Ora 164

user601042Jul 16 2010 — edited Jul 16 2010
Hi ,
I have following code to insert into remote table and used autonomous transaction like below. When it called from java (XA datasource) getting followoing error - ora 164

ORA-00164: distributed autonomous transaction disallowed within migratable distributed transaction

Cause: A request was made by the application to start a distributed autonomous transaction when the application was in a migratable distributed transaction.

Action: Roll back or commit the current distributed transaction first.

My code is like belwo

PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN

--INSERT LOB VALUE
INSERT INTO local_work_table (MSG_TYPE_T,APPL_N,MSG_I,XML_DATA_T,STAT_C,CRTE_D,CRTE_USER_I)
VALUES (msg_type_in,app_name_in,msg_id_in,l_v_version||xml_msg_in,'N',sysdate,USER)
RETURNING ROWID
INTO l_r_rowid;

INSERT INTO Table_remote (MSG_TYPE,APP_NAME,MSG_ID,XML_DATA,STATUS,CREATE_DT,CREATED_BY)
SELECT MSG_TYPE_T,APPL_N,MSG_I,XML_DATA_T,STAT_C,CRTE_D,CRTE_USER_I FROM DSTB_MSG_OUT_W
WHERE ROWID=l_r_rowid;

DELETE FROM local_work_table ;
commit;
end;

Table_remote is remote DB insertion using DB link.

Thanks,
Sujeeth
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 13 2010
Added on Jul 16 2010
6 comments
1,386 views