Trigger Timeout Loop Issue



Hi, folks,

We've developing a interface between our Oracle database
and some third-party applications, and we've run into a locking
issue I was hoping someone here might be able to help with.

In our database code, we have an AFTER trigger on a specific
table that uses the UTL_HTTP library to call a method of a web
service (written in C#). The web service then in turn calls a
stored procedure in the database which modifies the same
record in the same table (albiet a different column). However,
since the record is locked by the trigger, the stored procedure
delays until the trigger is complete, creating a deadlock-like
feedback loop that lasts until UTL_HTTP times out waiting for
the SOAP response message -- only when the trigger finishes
processing will the stored procedure (and thus the web service)
return.

One possible solution to this issue is to use multithreading in
the web service -- fork the thread, return from the method to send
the SOAP response and /then/ call the stored procedure in a
thread that can afford to wait for it to finish. But this is awkward,
indirect and inelegant coding, and adds explicit multithreading to
a project that doesn't otherwise need it.

We (myself, the C# guy, and our senior dev, the Oracle guy)
were wondering if there was any way to solve this more "cleanly"
in terms of database best practices. Specifically, is there any
way we can set the AFTER trigger to execute only once the
table update is truly complete and the table has been fully
unlocked? (There is no chance that the trigger will have to
rollback the transaction at all). Or is there a way to manually
unlock the locked part of the table within the trigger, before
calling the web service?

Any insight offered is appreciated!

-- Julian Mensch
.



Relevant Pages

  • RE: calling a web service from SQL Server
    ... the trigger calls the stored procedure correctly. ... helloworld.vb), however when I add a web reference to the web service, the ... Microsoft Online Community Support ...
    (microsoft.public.sqlserver.dts)
  • Re: Trigger, alternative way to pass variable to trigger
    ... You don't have to execute the setUser command in the master database, ... create trigger trigger name ... to call stored procedure or execute sql commands and let it handle it the ... Pro SQL Server 2000 Database Design ...
    (microsoft.public.sqlserver.programming)
  • Oracle connectivity
    ... I am trying to work out the best way to communicate with an Oracle database ... - Execute an Oracle PL/SQL stored procedure designed to return simple/scalar ... Write a Web Service, most likely of the XML variety, to run on the host. ... Web Service receives requests from the client .Net CF application and ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Having Trouble with triggers!! ~ Please Help!
    ... >Try changing your trigger. ... >> master database and three satellite using triggers. ... >> I created two test databases, one on the same server ... >> the stored procedure, right?!... ...
    (microsoft.public.sqlserver.replication)
  • Writing into Files from Stored Procedures
    ... I'm trying to write the result set of a sql query into a file, ... stored procedure. ... to my database, a trigger is called. ... PS: my database is Informix. ...
    (comp.databases.informix)