Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: "unlock" from trigger
A copy of this was sent to ragnvald_at_nta.no (Ragnvald Torgeirsson Blindheim; UiO;
V96)
(if that email address didn't require changing)
On 15 Jun 1998 07:14:27 GMT, you wrote:
>
>Hi.
>
>I need to be able to LOCK TABLE and unlock this table from a trigger.
>Problem is, the only way I have found to unlock a "LOCK" is to COMMIT.
>However, COMMITs are not allowed in triggers.
>
>Any suggestions?
>
>(the reason I use LOCK TABLE is that the trigger updates a table, and
>once in a while a UNIX cron job LOCKs the update table, exports the data
>and deletes all the data in the table. Using LOCK TAbLE in EXCLUSIVE MODE
>avoids concurrency problems).
>
>Any help appreciated!
>
>Ragnvald
Locks (with the exception of ones you programatically get via the dbms_lock package) can only be released on commit.
I don't understand why you believe you need to lock the table in the trigger however -- if the CRON job started and had the lock on the table, the trigger would block. If the trigger got fired before the CRON job, the lock table in the cron job would block the update...
They would serialize anyway.
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA
http://govt.us.oracle.com/ -- downloadable utilities
Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Mon Jun 15 1998 - 05:13:31 CDT