Re: Mysql pushing data to client

2006-09-28 Thread Dave G
Thanks for pointing that out, I'll go with James solution.

David Godsey
 David Godsey wrote:
   I am looking for a way to write a client program that will wake up when
   there is new data in the database, much like replication.
  
   So instead of my client pulling the database on some fixed interval, I
   would like the mysql daemon to push the data to my client when there is
   new data.  I assume this is possible given that it is done with
   replication.  Does anybody have information on how to implement a
 client
   program like this?
  
   I'm using PHP, but I'm not opposed to using C or C++ for this kind of
   functionality.

 James Neff wrote:
   I'm doing something similar now and I just have my clients (a java app)
   periodically check a small table that indicates theres data ready for
   them.  It's a simple SELECT count(*) ... that is fairly inexpensive
   and the does this once every 5 seconds.
  
   I don't know if there is a built-in solution for mysql but this gets
 the
   job done for me.
  
   Let me know if you find a better way to do this.

 David Godsey wrote:
 That is a good work around, I appreciate the idea.  The optimal would be
 a
 client that listens on the mysql thread the pushes data to the database.
 But if there is no way to tap into that thread, the select count(*)
 would do.

 There must be a way to do it though, since it is done with replication.

 Except that it isn't.  The Master writes to its local binlog.  The slave
 pulls
 updates from the master periodically.  See the manual for all the details
 http://dev.mysql.com/doc/refman/4.1/en/replication-intro.html.

 You could write a daemon to run on the mysql server, which would watch for
 local
 changes and push them to your client, but that sounds overly complex to me
 compared to James' solution.

 Michael




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Mysql pushing data to client

2006-09-25 Thread Michael Stassen

David Godsey wrote:
 I am looking for a way to write a client program that will wake up when
 there is new data in the database, much like replication.

 So instead of my client pulling the database on some fixed interval, I
 would like the mysql daemon to push the data to my client when there is
 new data.  I assume this is possible given that it is done with
 replication.  Does anybody have information on how to implement a client
 program like this?

 I'm using PHP, but I'm not opposed to using C or C++ for this kind of
 functionality.

James Neff wrote:
 I'm doing something similar now and I just have my clients (a java app)
 periodically check a small table that indicates theres data ready for
 them.  It's a simple SELECT count(*) ... that is fairly inexpensive
 and the does this once every 5 seconds.

 I don't know if there is a built-in solution for mysql but this gets the
 job done for me.

 Let me know if you find a better way to do this.

David Godsey wrote:

That is a good work around, I appreciate the idea.  The optimal would be a
client that listens on the mysql thread the pushes data to the database. 
But if there is no way to tap into that thread, the select count(*)

would do.

There must be a way to do it though, since it is done with replication.


Except that it isn't.  The Master writes to its local binlog.  The slave pulls 
updates from the master periodically.  See the manual for all the details 
http://dev.mysql.com/doc/refman/4.1/en/replication-intro.html.


You could write a daemon to run on the mysql server, which would watch for local 
changes and push them to your client, but that sounds overly complex to me 
compared to James' solution.


Michael

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Mysql pushing data to client

2006-09-23 Thread Dave at Mysql
That is a good work around, I appreciate the idea.  The optimal would be a
client that listens on the mysql thread the pushes data to the database. 
But if there is no way to tap into that thread, the select count(*)
would do.

There must be a way to do it though, since it is done with replication.

Thanks

David Godsey

 I'm doing something similar now and I just have my clients (a java app)
 periodically check a small table that indicates theres data ready for
 them.  It's a simple SELECT count(*) ... that is fairly inexpensive
 and the does this once every 5 seconds.

 I don't know if there is a built-in solution for mysql but this gets the
 job done for me.

 Let me know if you find a better way to do this.

 Thanks,
 James




 Dave at Mysql wrote:

I am looking for a way to write a client program that will wake up when
there is new data in the database, much like replication.

So instead of my client pulling the database on some fixed interval, I
would like the mysql daemon to push the data to my client when there is
new data.  I assume this is possible given that it is done with
replication.  Does anybody have information on how to implement a client
program like this?

I'm using PHP, but I'm not opposed to using C or C++ for this kind of
functionality.

Thanks.

David Godsey








-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Mysql pushing data to client

2006-09-21 Thread Dave at Mysql
I am looking for a way to write a client program that will wake up when
there is new data in the database, much like replication.

So instead of my client pulling the database on some fixed interval, I
would like the mysql daemon to push the data to my client when there is
new data.  I assume this is possible given that it is done with
replication.  Does anybody have information on how to implement a client
program like this?

I'm using PHP, but I'm not opposed to using C or C++ for this kind of
functionality.

Thanks.

David Godsey


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Mysql pushing data to client

2006-09-21 Thread Douglas Sims

Hi David

Sybase and MS-SQL have a built-in stored procedure called xp_cmdshell  
which lets you execute shell commands from within a stored procedure  
or otherwise within the database process.


MySQL doesn't (I'm fairly sure) provide anything like that (although  
I think someone had written a UDF in C that might do that).  I don't  
think that's really a problem with MySQL, on the contrary it's a good  
thing because xp_cmdshell is potentially a big security issue, as any  
shell program would be running as the same user who's running the  
MySQL server.


It will probably work better if you put the triggering code in the  
part of your application (like the PHP page, whatever)  that changes  
the data you want to be notified about, instead of in the database  
itself.



Douglas Sims
[EMAIL PROTECTED]




On Sep 21, 2006, at 3:14 PM, Dave at Mysql wrote:

I am looking for a way to write a client program that will wake up  
when

there is new data in the database, much like replication.

So instead of my client pulling the database on some fixed interval, I
would like the mysql daemon to push the data to my client when  
there is

new data.  I assume this is possible given that it is done with
replication.  Does anybody have information on how to implement a  
client

program like this?

I'm using PHP, but I'm not opposed to using C or C++ for this kind of
functionality.

Thanks.

David Godsey


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]