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
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
ASKER
yeah the problem is that the code will be mysql specific right?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://dev.mysql.com/doc/mysql/en/adding-functions.html
Best Regards,
DeepuAbrahamK