Microsoft
Software
Hardware
Network
Question : Insert code in Trigger causes ORA01591 lock held by in doubt transaction
Hi there,
We use the Oracle transparent gateway for informix to access an informix db from oracle.
This is generally working.
When I create a trigger on the oracle db and it is fired, it causes the ORA-01591 error message. It looks like there is a problem with the 2point commit phase.
Here the trigger code:
CREATE OR REPLACE TRIGGER BTO_QMAP.AI_CELLS
AFTER INSERT
ON BTO_QMAP.QMAP_GROUPS_CELLS
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
WHEN (
new.CELLID like '%G'
)
BEGIN
insert into "qmap_groups_cells"@IFMX_M
ETRICA ("fk_subgroup_name","fk_us
er_id","ce
llid")
VALUES (:new.fk_subgroup_name, :new.fk_user_id, :new.cellid);
END ;
The values are inserted correctly into the informix database. But in oracle a lock is created for this dirstributed transaction. After accessing the involved table, the ORA-01591 "lock held by in-doubt transaction" is raised. After a COMMIT force 'transaction id', the lock is released.
When I execute a similar insert statement directly (not via trigger), then everything works fine.
Any ideas would be appreciated....
br
Kenny
Answer : Insert code in Trigger causes ORA01591 lock held by in doubt transaction
I am not able to reproduce this on my Oracle 9.2.0.4.
However I would suggest to enclose the remote access in an autonomous transaction:
--------------------------
----------
-------
CREATE OR REPLACE TRIGGER BTO_QMAP.AI_CELLS
AFTER INSERT
ON BTO_QMAP.QMAP_GROUPS_CELLS
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
WHEN (
new.CELLID like '%G'
)
declare
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
insert into "qmap_groups_cells"@IFMX_M
ETRICA ("fk_subgroup_name","fk_us
er_id","ce
llid")
VALUES (:new.fk_subgroup_name, :new.fk_user_id, :new.cellid);
commit;
exception
when others then rollback; raise;
END ;
--------------------------
----------
----------
--
Random Solutions
Adding IE Intranet Zone Via GPO
powershell Get-Acl to Set-Acl system date variable and output to file
8 GB DDR2 PC-5300 RAM installed, shows up in BIOS, but in not in XP
Form looks great on all browsers except Firefox 3
VB6 application failed at MS Vista Help Please
windows cannot find the local profile and is logging you on with a temporary profile.
Simple PayPal Shopping Cart
Not able to print color to the ImageRunner c2880i
Two Exchange Servers, Split domain?
Can't receive emails that are sent from gmail, hotmail, aol accounts, maybe yahoo as well