Re: Can MySQL start/fire an external process?
- From: Bill Karwin <bill@xxxxxxxxxx>
- Date: Wed, 10 Aug 2005 16:27:04 -0700
Mark Matthews wrote:
Yes those are limitations one has to be aware of. Some can be mitigated depending on the language you write your UDF in. For example, you can mitigate most security concerns by writing your UDF in a "managed" language such as Java with the correct permissions set.
On the other hand, a Java exception that isn't caught and handled properly could cause mysqld to exit.
If the OP needs non-polling solutions, there's really no other way to make database state changes immediately available outside of the MySQL DBMS (and many others) without resorting to something such as a UDF called from a trigger.
Then I respectfully suggest that one shouldn't use the DBMS to notify other clients.
I thought of another risk of using UDF's in triggers to notify clients: what if the event-raising UDF is invoked within a transaction? This could occur before the transaction is committed. The clients will receive notification, but if they query for the data, they won't find it (unless they're doing dirty-reads). Also, the transaction could be rolled back, so the new data will never appear. But the client has still been notified of the new data. In short, events do not respect transaction isolation.
IMHO, the safe and correct way to do this is for the app that posts the data to notify other apps _without_ using the DBMS as the event channel. Use JMS, for instance. Make sure the data has been posted successfully, and the transaction is committed before sending the message notifying other clients.
Anyway, there's more than one way to do it, and these are my opinions about how I'd do it if the task were given to me.
Regards, Bill K. .
- References:
- Can MySQL start/fire an external process?
- From: johnfofawn
- Re: Can MySQL start/fire an external process?
- From: J. David Boyd
- Re: Can MySQL start/fire an external process?
- From: johnfofawn
- Re: Can MySQL start/fire an external process?
- From: J. David Boyd
- Re: Can MySQL start/fire an external process?
- From: Mark Matthews
- Re: Can MySQL start/fire an external process?
- From: Bill Karwin
- Re: Can MySQL start/fire an external process?
- From: Mark Matthews
- Can MySQL start/fire an external process?
- Prev by Date: Re: Can MySQL start/fire an external process?
- Next by Date: Re: JDBC for csv inputstream
- Previous by thread: Re: Can MySQL start/fire an external process?
- Next by thread: Re: Can MySQL start/fire an external process?
- Index(es):
Relevant Pages
|
|