![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Is there any way to push notification from the database to a PowerBuilder application? I've played around with the "MESSAGE" statement with no luck. Background: I have two applications on two different machines. App 1 inserts data into the database. App 2 needs to see this new data in as close to real time as possible. Currently, I have to have app 2 poll the database for changes. It would be much more elegant if the database could push some kind (anykind) of notification to app2 when app1 did an insert. |
#3
| |||
| |||
|
|
In 9.0.1 the MESSAGE ... FOR CONNECTION feature was added that allows a message to be sent to another connection. The connection receiving the message would get the message through a callback function when the current request finished, or promptly if a WAITFOR DELAY statement was executing. In 11.0.1 the MESSAGE ... FOR CONNECTION ... IMMEDIATE syntax was added which allowed a second connection to receive a message promptly without needing to be making requests or be executing the WAITFOR DELAY statement. That said, I'm not sure if it is possible to register the ODBC message callback function from PowerBuilder. The message callback function is registered using the SQLSetConnectAttr( ... SA_REGISTER_MESSAGE_CALLBACK ... ) ODBC call. |
#4
| |||
| |||
|
|
No, PowerBuilder does not support callback functions at all. The SQLAny help file for WAITFOR contains this bit of SQL code: SET msg = CONNECTION_PROPERTY('MessageReceived'); Any idea how I would pull back that CONNECTION_PROPERTY() thing from a PB / ODBC client? Ian McHardy [Sybase iAnywhere] wrote: In 9.0.1 the MESSAGE ... FOR CONNECTION feature was added that allows a message to be sent to another connection. The connection receiving the message would get the message through a callback function when the current request finished, or promptly if a WAITFOR DELAY statement was executing. In 11.0.1 the MESSAGE ... FOR CONNECTION ... IMMEDIATE syntax was added which allowed a second connection to receive a message promptly without needing to be making requests or be executing the WAITFOR DELAY statement. That said, I'm not sure if it is possible to register the ODBC message callback function from PowerBuilder. The message callback function is registered using the SQLSetConnectAttr( ... SA_REGISTER_MESSAGE_CALLBACK ... ) ODBC call. |
![]() |
| Thread Tools | |
| Display Modes | |
| |