| Greg Fenton 2005-12-31, 11:23 am |
| wilf silversides wrote:
> I would like to create a variable/option that can be seen by ALL connections
> to a database.
Data in variables and [global] temporary tables are only visible for the
current connection, so you cannot have a "global variable" holding a
common value. For this, I think the only way is to create a base table.
> Basically I'd like to store the address and port for a data change
> notification server to be contacted (using sa_send_udp) when data changes
> in the database. I'd prefer not to always be looking this up in a table to
> know if it is connected and where it is.
I'm not sure what you mean by a "notification server".
Server Initiated Synchronization (SIS), a feature of MobiLink, may be
something you want to look at. Using the dblsn client, a remote
database "registers" itself and uploads its current IP address/port.
When the SIS server (called the "notifier") decides it has new data for
a given remote, it contacts the listener (dblsn) on the provided IP
address/port and passes a "synch now" message to that remote.
> Or is the smart way just to create connection level global variables (via
> create variable)out of a configuration table the first time each connection
> tries to use the notification system. Then how do I know if the
> notification system has shut down
You could create the variable in a login stored procedure, but then
again, why not just have the client app query the table directly? Or
the approach I'd likely take is to write a stored proc that the client
can call.
> Or have I missed some really obvious better way to do this (like MESSAGE and
> WAITFOR)?
I'm not entirely clear as to what you are trying to do here. Are you
looking to notify current connections of changes to the location of this
"notification server"?
greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
|