Database Connections

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Database Connections

  • Creator
    Topic
  • #49396
    David Harrison
    Participant

      I have an outbound thread set up to connect to a database and update it with incoming messages using a tcl proc in TPS Outbound data. This works ok but  I need to know how to handle errors resulting from any inability to update the database.

      With a sockets connection, if connection to the outbound host is lost, messages persist in the queue until the connection is restored. This is what I want to achieve if connection to the database is lost. Any ideas welcome.

      Thanks,

      Dave

    Viewing 1 reply thread
    • Author
      Replies
      • #61777
        David Barr
        Participant

          Use the “UPOC” protocol on the thread, and call the database update proc from within the protocol Write TPS.

          In your proc that does the update, set a global variable to indicate whether or not the update succeeded.

          Use “save_ob_msg” from the recover_33.tcl as your Send OK proc.

          Don’t configure an Inbound Reply proc.

          Use a custom version of the “resend_ob_msg” from the recover_33.tcl as your Reply Gen proc.  You need to modify the proc so that it will check your global variable and only resend the message if it failed.

        • #61778
          David Harrison
          Participant

            Works fine thank you

        Viewing 1 reply thread
        • The forum ‘Cloverleaf’ is closed to new topics and replies.