Solved

Kind of crazy file watch mechanism

Posted on 2007-11-24
3
168 Views
Last Modified: 2010-04-01
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
0
Comment
Question by:DJ_AM_Juicebox
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 11

Expert Comment

by:DeepuAbrahamK
ID: 20343422
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
0
 

Author Comment

by:DJ_AM_Juicebox
ID: 20343446
yeah the problem is that the code will be mysql specific right?
0
 
LVL 11

Accepted Solution

by:
DeepuAbrahamK earned 500 total points
ID: 20343451
Yeah when you go for trigger it will be specific to the DB. Polling DB is not that efficent way of doing it. But you can check the db in a fixed interval of time.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question