home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / database / sybase / 621 < prev    next >
Encoding:
Text File  |  1993-01-07  |  2.9 KB  |  67 lines

  1. Newsgroups: comp.databases.sybase
  2. Path: sparky!uunet!shearson.com!news
  3. From: fgreco@shearson.com (Frank Greco)
  4. Subject: SUMMARY - Notifying clients of table mods
  5. Message-ID: <1993Jan7.145200.12137@shearson.com>
  6. Sender: news@shearson.com (News)
  7. Organization: Lehman Brothers
  8. Date: Thu, 7 Jan 1993 14:52:00 GMT
  9. Lines: 56
  10.  
  11.     Thanks for the many, many responses everyone.  Here's my
  12.     original post:
  13.  
  14. >I have a potential appliation where I would like to notify distributed
  15. >client processes (LAN) that a table(s) was modified in a Sybase database.
  16. >
  17. >I'd like to not use OpenClient at this point if at all possible.
  18. >
  19. >My initial thought is to write a master process that polls a
  20. >"modifications" table (perhaps created via trigger(s)) that tracks what
  21. >was modified and then looking up in a "subscriber" table to see who to
  22. >notify.  Then, if needed, send some data via a socket (I'm assuming all
  23. >SPARC machines) to the appropriate subscribers.
  24. >
  25. >Another thought would be to front-end all the queries and, upon
  26. >successful table modification, directly notify any clients (again
  27. >through sockets).  This alternative would seem to have performance
  28. >ramifications.
  29. >
  30. >I'd appreciate any comments that any of you might have,
  31.  
  32.     The overwhelming number of folks said to use OpenServer (my
  33.     post was faulty in that I said I'd rather not use "OpenClient";
  34.     I meant "OpenServer").  Many others (correctly) told me that
  35.     Sybase cannot call routines in your pgm directly.
  36.  
  37.     While you cannot directly have a trigger invoke a routine
  38.     (unfortunately) in your application via Sybase [I believe
  39.     Interbase can do this], you can setup a trigger quite easily to
  40.     call OpenServer via an RPC.  From there all clients that are
  41.     registered to be interested in this RPC will be notified.
  42.  
  43.     There are other places in dblib where the dataserver calls your
  44.     own specified routines (e.g., message/error handling); it'd be
  45.     nice if there was some mechanism to allow triggers (and
  46.     alerters ... hint... hint) to do this *directly* in Sybase.
  47.  
  48.     Since I really didn't want to use OpenServer for this
  49.     particular application for various reasons, I decided on using
  50.     ToolTalk (from Sun) and a little polling program.  Whenever an
  51.     update/delete/insert happens, an entry in written into a
  52.     logtable.  My polling (delay is dynamically set) ToolTalk
  53.     program looks into this table for database activity, and if
  54.     there is any, uses ToolTalk messages to notify interested
  55.     parties via multicasting.  Really wasn't too bad to write; took
  56.     me about 1 week to complete this with a nice API for client
  57.     (ie, "interested") applications.
  58.  
  59.     Thanks to everyone (I got over 50 responses)!
  60.  
  61.     Frank G.
  62. --
  63. +-On Assignment at: Lehman Brothers-+-Office: Mercury Technologies, Inc.-+
  64. | World Financial Center, 11th Floor| PO Box 529                         |
  65. | New York City, NY 10285 Desk: 1515| Fanwood, NJ 07023                  |
  66. | email: fgreco@shearson.com        | email: fgreco@mercury.com          |
  67.