Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Kind of crazy file watch mechanism

Posted on 2007-11-24
3
Medium Priority
?
171 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:Deepu Abraham
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:
Deepu Abraham earned 2000 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
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.
Suggested Courses

670 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