Best Practices for EAServer clients including HA/Failover – PB Docs 125

Best Practices for EAServer clients including HA/Failover

The best practice is to have ConnectToServer() and CreateInstance() inside
the same event (a button, for example). If failover occurs then
the client reissues the same coding, which needs to pass through ConnectToServer() again
to connect to the next EAServer in the cluster. In this case, the
next EAServer in cluster would be found successfully.

Scenario in PB Client Application

Suppose ConnectToServer() is
inside a window Open() event
and CreateInstance() is
inside a button in the same window. If failover occurs while window
is active, and the end user clicks the button again, the CreateInstance() itself
is not able to resolve the failover reconnection and PowerBuilder
will fail with CORBA_COMM_FAILURE.

Example

This problem can be avoided by including both ConnectToServer()
and CreateInstance() inside same event or method. For instance:

In the window Open() event, place the following:

Then place the following in a button within the same window:

This ensures the failover to the next server works for EAServer client PowerBuilder
application, if failover occurs when the end user presses the button
again.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x