Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Use Trigger/Procedure for long program?
Message
From
08/06/2010 14:20:36
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Title:
Use Trigger/Procedure for long program?
Miscellaneous
Thread ID:
01467976
Message ID:
01467976
Views:
96
Hello Everybody.

I know this is the SQL Server section (my question is regarding MYSQL) , but I hope that the MYSQL is close enough to the SQL Server in regards to my question that I can post this here.

I am relatively new to MySQL and have a behavior or structural question.

I am in the process of writing a php website with a MySQL db layer. Here is the scenario:

User enters some data which needs to start a routine based on the data entered and can run from just a view seconds to hours. This routine needs to update some records in the same table and in other tables. This routine also needs to run separately from the web-user who entered the data. There are other users who may also enter data and need to start that routine (or at least check if the routine is running already).

I was thinking to have php update the table, therefore start an after trigger. But I don't think the long running trigger will allow other modifications to the table (not the same record). Is this correct?

Then I was thinking that the trigger could call a stored procedure, but I think a proc is just an extension of the trigger and would cause the same effect. How about that - is that correct?

A windows scheduler or a unix cron job would do it by checking the status of that table, but i don't like that because i don't trust that solution too much and it would be slower.

What is the correct way of doing this? Is any of the above mentioned ways the correct way? If yes, could you please elaborate on how the architecture of MySQL handles that specifically in regards with the user maybe disconnecting and the routing will still run.

Thank you for your help in advance!
Next
Reply
Map
View

Click here to load this message in the networking platform