Re: Database notification



> No, triggers start stored procedures on the server side, but nothing
on
> the client side.

Yes, that stored procedure can send a message (like JMS
publish/subscribe) to the client. I don't know what kind of languages
MySQL supports for stored procedures. If it doesn't support java, you
might consider switching to a database that support java.

> JDBC doesn't provide this kind of mechanism. You have
> to use a timer in each client and check for changes in the database
at
> certain intervals (for instance every 10 secs or so).

Polling is a solution, but a rather primitive one.

> It helps if you
> add a table with last modification timestamps, for instance one per
> table, so that your client needs to perform only simple checks.

You would still need triggers that updates the new timestamp table. If
you use this approach I would recommend a table like this,
log(id, tablename, columnname, timestamp)
and a trigger on every other table in your database that inserts a
record in this one.

Fredrik Bertilsson
http://butler.sourceforge.net

.



Relevant Pages

  • Re: Database notification
    ... >>No, triggers start stored procedures on the server side, but nothing ... > publish/subscribe) to the client. ... MySQL-5.0 supports triggers, and while it doesn't yet support Java ... let people write their UDFs in Java, so relatively easily you could put ...
    (comp.lang.java.databases)
  • Re: Independant QUery
    ... When you have COM component in a machine (server) and if you need invoke ... that COM component from another machine (client), ... These are the system stored procedures (For example: ... >> triggers ...
    (microsoft.public.sqlserver.programming)
  • TimeStamp Question
    ... Does SQL server change/generate the timestamp value each time I update or ... Or do I need to create a new timestamp value on ... the client side and send it to my stored procedures? ...
    (microsoft.public.sqlserver.server)
  • Re: Business objects, subset of collection
    ... SQL databases sucks for searching large data sets, ... TPC implementations rely heavily on stored procedures. ... Application modules that are executed on the client side but are stored on the server side. ... Lets say you want to find all unpaid invoices. ...
    (comp.object)
  • Re: Portable stored procedures
    ... > JDatastore lets you store binary streams outside the table scema. ... Other databases usually do not store BLOB's ... > you will have to write the function in the client in Java (or whatever ... >> stored procedures written in some proprietary language. ...
    (comp.lang.java.databases)