notify/listen?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Christian Welzel

    notify/listen?

    Hi there,

    can somebody tell me if there is a mechanism in db2 which implements
    a notify/listen for external db clients?
    Postgres has such a mechanism where a client programm can connect to
    the db and send a "listen <name>" sql command and then gets a message
    if someone in the system issued a "notify <name>".
    This way the client does not need to poll the database if it wants
    to be uptodate to the current table status.

    --
    MfG, Christian Welzel aka Gawain@Regenbog en

    GPG-Key: http://www.camlann.de/key.asc
    Fingerprint: 4F50 19BF 3346 36A6 CFA9 DBDC C268 6D24 70A1 AD15
  • Ian

    #2
    Re: notify/listen?

    Christian Welzel wrote:
    Hi there,
    >
    can somebody tell me if there is a mechanism in db2 which implements
    a notify/listen for external db clients?
    Postgres has such a mechanism where a client programm can connect to
    the db and send a "listen <name>" sql command and then gets a message
    if someone in the system issued a "notify <name>".
    This way the client does not need to poll the database if it wants
    to be uptodate to the current table status.
    There is no built-in way to do this with DB2.




    Comment

    • Christian Welzel

      #3
      Re: notify/listen?

      Ian wrote:
      There is no built-in way to do this with DB2.
      Is there some other mechanism to get a notification delivered
      to an external client on table inserts/updates (except polling)?

      --
      MfG, Christian Welzel aka Gawain@Regenbog en

      GPG-Key: http://www.camlann.de/key.asc
      Fingerprint: 4F50 19BF 3346 36A6 CFA9 DBDC C268 6D24 70A1 AD15

      Comment

      • Ian

        #4
        Re: notify/listen?

        Christian Welzel wrote:
        Ian wrote:
        >
        >There is no built-in way to do this with DB2.
        >
        Is there some other mechanism to get a notification delivered
        to an external client on table inserts/updates (except polling)?
        >
        Nothing that's built in to the engine. But you could probably use
        MQ series (or whatever it's called now) or your own custom functions
        to do something like this.

        Comment

        • Christian Welzel

          #5
          Re: notify/listen?

          Ian wrote:
          Nothing that's built in to the engine. But you could probably use
          MQ series (or whatever it's called now) or your own custom functions
          to do something like this.
          I solved it now with my own udf. i wrote a 10 line c program, that
          simply opens a named pipe and writes something into it. The client
          now only has to do some blocking read on the pipe and all goes fine.

          --
          MfG, Christian Welzel aka Gawain@Regenbog en

          GPG-Key: http://www.camlann.de/key.asc
          Fingerprint: 4F50 19BF 3346 36A6 CFA9 DBDC C268 6D24 70A1 AD15

          Comment

          Working...