Init (obsolete) – PB Docs 2017

Init (obsolete)

PowerScript function

Description

Initializes an instance of the CORBACurrent service object for
client- or component-managed transactions.

Obsolete function

Init is obsolete, because EAServer is no longer supported since
PowerBuilder 2017.

Applies to

CORBACurrent objects

Syntax

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.

Return value

Integer.

Returns 0 if it succeeds and one of the following values if the
service object could not be initialized:

-1 — Unknown error

-2 — Service object not running in EAServer (no argument) or
Connection object not connected to EAServer (argument is Connection
object)

-3 — ORB initialization error

-4 — Error on a call to the
ORB.resolve_initial_references(“TransactionCurrent”) method

-5 — Error on a call to the narrow method

Usage

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.

Examples

This example shows the use of Init in a PowerBuilder
EAServer component to initialize an instance of the CORBACurrent
object:

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:

In this example, the PowerBuilder client application calls the
Init function using a valid URL:

See also

BeginTransaction
(obsolete)

CommitDocking

GetContextService

GetStatus (obsolete)

GetTransactionName
(obsolete)

ResumeTransaction
(obsolete)

RollbackOnly
(obsolete)

RollbackTransaction
(obsolete)

SetTimeout (obsolete)

SuspendTransaction
(obsolete)


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