Link to home
Start Free TrialLog in
Avatar of DJ_AM_Juicebox
DJ_AM_Juicebox

asked on

Kind of crazy file watch mechanism

Hi,

This is kind of crazy and was looking for advice. I have a mysql database. Some external process may write a record to my table, which should start a new process. Something like:

    1) Mysql database is created
    2) Some external process creates a new record in the table with data 192.168.1.2, "hello"
    3) I want a local process to be created now and send data "hello" to 192.168.1.2

I was hoping to use triggers but you can't start processes with them, and besides i think the code is specific to mysql. I'm using an odbc lib so was hoping to make this generic so any db could work in place of mysql.

The only generic solution I can come up with is having a process that just polls the table of interest every 10 seconds and handles any new records it finds. I hate polling but I don't know a better way to handle this. Anyone have any better ideas?

Thanks
Avatar of Deepu Abraham
Deepu Abraham
Flag of United States of America image

You can use triggers, well, user defined functions can be invoked by a trigger
http://dev.mysql.com/doc/mysql/en/adding-functions.html 

Best Regards,
DeepuAbrahamK
Avatar of DJ_AM_Juicebox
DJ_AM_Juicebox

ASKER

yeah the problem is that the code will be mysql specific right?
ASKER CERTIFIED SOLUTION
Avatar of Deepu Abraham
Deepu Abraham
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial