Sets ORB property values or initializes an instance of the CORBACurrent service object.
To |
Use |
---|---|
Set ORB property values for client connections to EAServer using the JaguarORB object |
|
Initialize an instance of the CORBACurrent service object for client- or component-managed transactions |
Sets ORB property values. This function is used by PowerBuilder clients connecting to EAServer.
JaguarORB objects
jaguarorb.Init ( options )
Argument |
Description |
---|---|
jaguarorb |
An instance of JaguarORB. |
options |
A string that specifies one or more ORB property values. If you specify multiple property values, you need to separate the property values with commas. For a complete list of supported ORB properties, see the online Help for the Options property of the Connection object. |
Long. Returns 0 if it succeeds and a negative number if an error occurs.
ORB properties configure settings required by the EAServer ORB driver.
You do not need to call the Init function to use the JaguarORB object. If you do not call Init, the EAServer ORB driver uses the default property values.
The Init function can be called multiple times on the same JaguarORB object. PowerBuilder creates a new internal instance of the JaguarORB object the first time and uses this object for all subsequent calls.
For additional examples, see the functions on the See also list.
The following example shows the use of the Init function to set the RetryCount and RetryDelay ORB properties:
JaguarORB my_orb
CORBAObject my_corbaobj
...
...
my_orb = CREATE JaguarORB
my_orb.Init("ORBRetryCount=3,ORBRetryDelay=1000")
...
...
Initializes an instance of the CORBACurrent service object.
CORBACurrent objects
CORBACurrent.Init ( { connection | URL} )
Argument |
Description |
---|---|
CORBACurrent |
Reference to the CORBACurrent service instance. |
connection |
The name of the Connection object for which a connection has already been established to a valid EAServer host. Either connection or URL is required if the Init function is called by a client. |
URL |
String. The name of a URL that identifies a valid EAServer host. Either connection or URL is required if the Init function is called by a client. |
Integer. Returns 0 if it succeeds and one of the following values if the service object could not be initialized:
-2 Service object not running in EAServer (no argument) or Connection object not connected to EAServer (argument is Connection object)
-4 Error on a call to the ORB.resolve_initial_references("TransactionCurrent") method
The Init function can be called from a PowerBuilder component running in EAServer whose transaction property is marked as OTS style, or by a PowerBuilder client. The Init function must be called to initialize the CORBACurrent object before any other functions are called. EAServer must be using the two-phase commit transaction coordinator (OTS/XA) and a reference to the CORBACurrent object must first be obtained using the GetContextService function.
When Init is called from a PowerBuilder component running in EAServer, no arguments are required. If the calling component is not marked as OTS style, the CORBACurrent object is not initialized.
When Init is called from a PowerBuilder client and the client is responsible for the transaction, the CORBACurrent object must be initialized by calling Init with either a Connection object or a URL string as the argument. In the case of a Connection object, the client must already be connected to a valid EAServer host using that Connection object. Using a Connection object is preferred because the code is more portable.
This example shows the use of Init in a PowerBuilder EAServer component to initialize an instance of the CORBACurrent object:
// Instance variables: // CORBACurrent corbcurr int li_rc li_rc = this.GetContextService("CORBACurrent", corbcurr) IF li_rc <> 1 THEN // handle the error ELSE li_rc = corbcurr.init() IF li_rc <> 0 THEN // handle the error END IF END IF
In this example, Init is called by a PowerBuilder client application that has already connected to EAServer using the myconn Connection object and has created a reference called corbcurr to the CORBACurrent object:
li_rc = corbcurr.init( myconn ) IF li_rc <> 0 THEN // handle the error END IF
In this example, the PowerBuilder client application calls the Init function using a valid URL:
li_rc = corbcurr.init( "iiop://localhost:2000" ) IF li_rc <> 0 THEN // handle the error END IF