public interface TuxApplicationToMonitorInterface
Modifier and Type | Method and Description |
---|---|
int |
tpabort(long flags)
tpabort() signifies the abnormal end of a transaction. |
int |
tpacall(java.lang.String svc,
weblogic.wtc.jatmi.TypedBuffer idata,
long flags)
Sends a request message to the service named by svc.
|
int |
tpadvertise(java.lang.String svcname,
java.lang.String clsname,
java.lang.String methodnm,
long flags)
tpadvertise() allows a application to advertise the services that it offers.
|
int |
tpbegin(long trntime,
long flags)
tpbegin() signifies the beginning of a transaction. |
int |
tpbroadcast(java.lang.String lmid,
java.lang.String usrname,
java.lang.String cltname,
weblogic.wtc.jatmi.TypedBuffer data,
long flags)
tpbroadcast is used by a client or server to send an unsolicited message to
registered clients within the system.
|
TuxATMIReply |
tpcall(java.lang.String svc,
weblogic.wtc.jatmi.TypedBuffer idata,
long flags)
Sends a request and synchronously awaits the reply.
|
int |
tpcancel(int cd)
Cancels a call descriptor returned, cd, returned by tpacall.
|
int |
tpcommit(long flags)
tpcommit() signifies the end of a transaction,
using a two-phase commit protocol to coordinate participants. |
TuxATMIReply |
tpdequeue(java.lang.String qspace,
java.lang.String qname,
TPQCTL ctl,
long flags)
tpdequeue method can be used to take a message for processing from the queue
tpdequeue method can be used to take a message for processing
from the queue named by qname in the qspace queue space. |
int |
tpenqueue(java.lang.String qspace,
java.lang.String qname,
TPQCTL ctl,
weblogic.wtc.jatmi.TypedBuffer data,
long flags)
tpenqueue method can be used to store a message on the queue
tpenqueue method can be used to store a message on the queue named by qname
in qspace queue space. |
weblogic.wtc.jatmi.TypedXML |
tpfml32toxml(weblogic.wtc.jatmi.TypedFML32 fmldata,
java.lang.String xfile,
java.lang.String rtag,
long flags)
tpfml32toxml is used to convert a TypedFML32 object to a TypedXML object.
|
weblogic.wtc.jatmi.TypedXML |
tpfmltoxml(weblogic.wtc.jatmi.TypedFML fmldata,
java.lang.String xfile,
java.lang.String rtag,
long flags)
tpfmltoxml is used to convert a TypedFML object to a TypedXML object.
|
void |
tpforward(java.lang.String svcname,
weblogic.wtc.jatmi.TypedBuffer data,
long flags)
tpforward method allows a service routine to forward a client's request to
another service routine for further processing.
|
int |
tpgblktime(long flags)
tpgblktime retrieves a previously set blocktime value.
|
int |
tpgetlev()
tpgetlev() returns the current transaction level to the caller. |
TuxATMIReply |
tpgetrply(int cd,
long flags)
Returns a reply from a previously sent request.
|
int |
tpgprio()
tpgprio() returns the priority for the last request sent or received by the current thread
in its current context.
|
int |
tpnotify(CLIENTID cltid,
weblogic.wtc.jatmi.TypedBuffer data,
long flags)
tpnotify() method can be used by a client or server to send an unsolicited
message to an individual client.
|
int |
tppost(java.lang.String eventname,
weblogic.wtc.jatmi.TypedBuffer data,
long flags)
tppost method can be used to post an event and any accompanying data.
|
int |
tpresume(TPTRANID trnId,
long flags)
tpresume is used to resume work on behalf of a previously suspended transaction.
|
void |
tpreturn(int rval,
long rcode,
weblogic.wtc.jatmi.TypedBuffer rdata,
long flags)
Indicates that a service routine has completed.
|
int |
tpsblktime(int blktime,
long flags)
tpsblktime method can be used to set the blocktime value.
|
int |
tpscmt(long flags)
tpscmt method sets the TP_COMMIT_CONTROL characteristic to the value specified in flags.
|
int |
tpsprio(int prio,
long flags)
tpsprio sets the priority for the next request sent or forwarded by the current thread.
|
long |
tpsubscribe(java.lang.String eventexpr,
java.lang.String filter,
TPEVCTL ctl,
long flags)
Subscribes an event or set of events named by eventexpr.
|
TPTRANID |
tpsuspend(long flags)
tpsuspend() is used to suspend the transaction active in the caller's process.
|
int |
tpunadvertise(java.lang.String svcname,
long flags)
tpunadvertise() allows a application to unadvertise the services that
it offers.
|
int |
tpunsubscribe(long subscription,
long flags)
tpunsubscribe can be used to remove an event subscription or a set of event
subscriptions from the Oracle Tuxedo EventBroker's list of active subscriptions.
|
weblogic.wtc.jatmi.TypedFML |
tpxmltofml(weblogic.wtc.jatmi.TypedXML xmldata,
java.lang.String xfile,
java.lang.String rtag,
long flags)
tpxmltofml method can be used to convert a TypedXML object to TypedFML object.
|
weblogic.wtc.jatmi.TypedFML32 |
tpxmltofml32(weblogic.wtc.jatmi.TypedXML xmldata,
java.lang.String xfile,
java.lang.String rtag,
long flags)
tpxmltofml method can be used to convert a TypedXML object to TypedFML32 object.
|
TuxATMIReply tpcall(java.lang.String svc, weblogic.wtc.jatmi.TypedBuffer idata, long flags) throws TuxATMITPException, TuxATMITPReplyException
tpcall
sends a request to the service named
by svc
.
The type and sub-type of data must match one of the types
and sub-types recognized by svc
.svc
- The name of the Tuxedo serviceidata
- Pointer to the data buffer; null specifies no data sentflags
- The following is a list of valid flags:tpcall
- the function may block when waiting for the reply.
When TPNOBLOCK is not specified and a blocking condition exists, the
caller blocks until the condition subsides or a timeout occurs
(either transaction or blocking timeout).
tpcall
returns a reply object that contains
the reply data from the service and the service return status.
You should always check the return status of the reply object to determine
if the service returned successfully.TuxATMITPException
- Upon failure tpcall
sets tperrno in
TuxATMITPException to one of the following values. Unless otherwise noted,
failure does not affect the caller's transaction, if one exists.svc
is null or flags are invalid.
svc
because it does not exist,
it is a conversational service, or the name provided begins with "." - a dot.
svc
accepts.
svc
belongs to a server that does not support
transactions and TPNOTRAN was not set.
tpacall
with TPNOTRAN, TPNOBLOCK, and TPNOREPLY set.
TPSIGRSTRT
was not specified.
tpcall
was called improperly.
tpcall
returned successfully.
TuxATMITPReplyException
- If there was a service failure (TPESVCFAIL or
TPSVCERROR), the exception will also have the reply data from the service.
tperrno in TuxATMITPReplyException is set to one of the following values.TuxATMITPReplyException
.
If the service request was made on behalf of the caller's current transaction,
then the transaction is marked abort-only.
Note that regardless of whether the transaction has timed out, the only valid
communications before the transaction is aborted are calls to tpacall()
with TPNOREPLY, TPNOTRAN, and TPNOBLOCK set.
tpreturn
or tpforward
(for example, bad arguments were passed). No reply data
is returned when this error occurs. If the service request was made on behalf of
the caller's transaction (that is, TPNOTRAN was not set), then the transaction is
marked abort-only.
Note that regardless of whether the transaction has timed out, the only valid
communications before the transaction is aborted are calls to tpacall() with
TPNOREPLY, TPNOTRAN, and TPNOBLOCK set.
If either SVCTIMEOUT in the UBBCONFIG file or TA_SVCTIMEOUT in the TM_MIB is
non-zero, TPESVCERR is returned when a service timeout occurs.
int tpacall(java.lang.String svc, weblogic.wtc.jatmi.TypedBuffer idata, long flags) throws TuxATMITPException
tpsprio()
.svc
- The name of the Tuxedo service.idata
- A valid TypedBuffer object.flags
- The following is a list of valid flags:TuxATMITPException
- Upon failure, tpacall() sets tperrno to one of
the following values. (Unless otherwise noted, failure does not affect the
caller's transaction, if one exists.)
TuxATMIReply tpgetrply(int cd, long flags) throws TuxATMITPException
tpacall
.
By default, the function waits until the reply matching *cd arrives or a timeout occurs.cd
- It points a call descriptor returned by tpacall
.flags
- The following is a list of valid flags:tpurcode
contains an application defined value
that was sent as part of tpreturn
TuxATMITPException
- Upon failure, tpgetrply() throws TuxATMITPException,
and TuxATMITPException.gettperrno() can be used to get the error condition.
When TuxATMIConstants.TPGETANY bit value is specified, the real call descriptor
associated with the reply message can be got by invoking TuxATMIReply.getCd().
Upon failure, tpgetrply sets tperrno as indicated below. tpreturn
with TPFAIL. This is an application-level failure.
tpreturn
or tpforward
(for example, bad arguments were passed).
int tpcancel(int cd) throws TuxATMITPException
cd
- It is a call descriptor returned by tpacall
TuxATMITPException
- Upon failure, tpcancel() throws TuxATMITPException,
and TuxATMITPException.gettperrno() can be used to got the error condition.
Upon failure, tpcancel() sets tperrno to one of the following values:void tpreturn(int rval, long rcode, weblogic.wtc.jatmi.TypedBuffer rdata, long flags) throws TuxATMITPException
tpreturn
does not acts like a return
statement in
the C language. (that is, when tpreturn() is called, the service routine remains
in Java service. User must make sure the tpreturn() is the last execution
statement in Java service)
tpreturn
is used to send a service's reply message. If the
program receiving the reply is waiting in either tpcall()
,
tpgetrply()
, then after a successful call to tpreturn(), the reply
is available in the receiver's buffer.
If the service routine was in transaction mode,tpreturn()
places the service's portion of the transaction in a state from which it may
be either committed or rolled back when the transaction is completed.
A service may be invoked multiple times as part of the same transaction so it
is not necessarily fully committed or rolled back until either tpcommit()
or tpabort()
is called by the originator of the transaction.
tpreturn()
should be called after receiving all replies
expected from service requests initiated by the service routine. Otherwise,
depending on the nature of the service, either a TPESVCERR status or a TPEV_SVCERR
event will be returned to the program that initiated communication with the
service routine.
Any outstanding replies that are not received will automatically be dropped by
the communication manager. In addition, the descriptors for those replies become
invalid.
rval
- rval
can be set to one of the following:tpreturn()
does not
necessarily finalize an entire transaction. Also, even though
the caller indicates success, if there are any outstanding
replies or open connections, if any work done within the service
caused its transaction to be marked rollback-only, then a failed
message is sent (that is, the recipient of the reply receives a
TPESVCERR indication or a TPEV_SVCERR event). Note that if a
transaction becomes rollback-only while in the service routine
for any reason, then rval should be set to TPFAIL.
If TPSUCCESS is specified for a conversational service, a
TPEV_SVCSUCC event is generated.
tpreturn()
marks the transaction as rollback-only (note that the transaction
may already be marked rollback-only).
Barring any failures in processing the return, the caller's data
is sent, if present.
One reason for not sending the caller's data is that a transaction
timeout has occurred.
In this case, the program waiting for the reply will receive an
error of TPETIME.
If TPFAIL is specified for a conversational service, a TPEV_SVCFAIL
event is generated.
rcode
- An application defined return code. It may be sent to the
program receiving the service reply. This code is sent
regardless of the setting of rval as long as a reply can be
successfully sent (that is, as long as the receiving call
returns success or TPESVCFAIL).
The value of rcode is available in the receiver in the variable,
tpurcode.rdata
- points to the data object of a reply to be sent. If data is
non-NULL, it must point to a valid Typed buffer object. It rdata is null, when a reply is expected by the program that invoked the service, then a reply is sent with no data. If no reply is expected, then tpreturn() returns sending no reply.
flags
- Currently, flags is reserved for future use and must be set to 0
(if set to a non-zero value, the recipient of the reply receives
a TPESVCERR indication or a TPEV_SVCERR event).TuxATMITPException
- If the a jvm-options is specified by -Dtuxedo.tjatmi.strictlyCheck=yes or
-Dtuxedo.tjatmi.strictlyCheck=true, tpreturn may throw a TuxATMITPException
when active outstanding replies are still existing. The error code is set
to TPERTNOUTRPLY.
When the exception with this error code is caught, the normal action is
call tpcancel() to cancel existing outstanding replies.
Java service routines, are expected to terminate using either tpreturn
or tpforward
.
If a service routine returns without using either tpreturn
(that is,
it uses the Java language return statement or just simply "falls out of the function") ,
the server will return a service error to the service requester. Any outstanding
asynchronous replies will be dropped. If the server was in transaction mode at the
time of failure, the transaction is marked rollback-only.
Since tpreturn
is the latst excecution statement in the service routine,
any errors encountered either in handling arguments or in processing cannot be
indicated to the function's caller.
Such errors cause tperrno to be set to TPESVCERR for a program receiving the service's
outcome via either tpcall
or tpgetrply
.
void tpforward(java.lang.String svcname, weblogic.wtc.jatmi.TypedBuffer data, long flags) throws TuxATMITPException
svcname
- This method forwards a request to the service named by svcname.data
- points to the data object of a reply to be sent. If data is
not null, it must point to a Typed buffer.flags
- Currently, flags is reserved for future use and must be set
to 0.TuxATMITPException
- Upon failure, tpforward() throws TuxATMITPException.
TuxATMITPException.gettperrno() can be used to retreive real error
condition as one of the following values:int tpadvertise(java.lang.String svcname, java.lang.String clsname, java.lang.String methodnm, long flags) throws TuxATMITPException
svcname
- The name of the Tuxedo service. It should be 127 characters
or less.clsname
- The server class name implementing the service method
specified with parameter methodnm.
The class should be in the class path accessible to or
associated with current server module.methodnm
- The method should be declared as public. The method has
only one TPSVCINFO type of parameter and a void type
of return value.flags
- It is currently reserved and must set to 0.TuxATMITPException
- Upon successfully completion, tpadvertise() returns 0.
Upon failure, tpadvertise() throws a TuxATMITPException.
TuxATMITPException.gettperrno() can be used to get the
error number. And TuxATMITPException.tpstrerror() can be
used to get the error description. The possible error
values are as following:int tpunadvertise(java.lang.String svcname, long flags) throws TuxATMITPException
svcname
- The name of the Tuxedo service. It should be 127 characters
or less.flags
- It is currently reserved and must set to 0.TuxATMITPException
- Upon failure, tpunadvertise() throws a TuxATMITPException.
TuxATMITPException.gettperrno() can be used to get the
error number. And TuxATMITPException.tpstrerror() can be
used to get the error description. The possible error values
are as following:long tpsubscribe(java.lang.String eventexpr, java.lang.String filter, TPEVCTL ctl, long flags) throws TuxATMITPException
eventexpr
- The event or set of events being subscribed to is named by
eventexpr.
It is a string of at most 255 characters containing a regular
expression.filter
- If present, filter is a string containing a Boolean filter rule
that must be evaluated successfully before the EventBroker posts
the event.ctl
- An event control object. (See TPQCTL).flags
- The following is a list of valid flags:TuxATMITPException
- Upon failure, tpsubscribe() throws TuxATMITPException,
and TuxATMITPException.gettperrno() can be used to get the error condition.
Upon failure, tpsubscribe sets tperrno to one of the following values. (Unless
otherwise noted, failure does not affect the caller's transaction, if one exists.)int tpunsubscribe(long subscription, long flags) throws TuxATMITPException
subscription
- It is an event subscription handle returned by tpsubscribe().flags
- The following is a list of valid flags:tpurcode
, can be used to get the
number of subscriptions deleted from the EventBroker's list of active subscriptions.TuxATMITPException
- Upon failure, tpunsubscribe throws TuxATMITPException, and
TuxATMITPException.gettperrno() can be used to get the error condition. Upon failure,
tpunsubscribe sets tperrno to one of the following values. (Unless otherwise noted,
failure does not affect the caller's transaction, if one exists.)int tppost(java.lang.String eventname, weblogic.wtc.jatmi.TypedBuffer data, long flags) throws TuxATMITPException
eventname
- Eventname is a string composed of at most 31 characters. Eventname's
first character cannot be a dot (".") as this character is reserved
as the starting character for all events defined by the Oracle
Tuxedo ATMI system itself.data
- Point a valid typed buffer object.flags
- The following is a list of valid flags:TuxATMITPException
- Upon failure, tppost throws a TuxATMITPException, and
TuxATMITPException.gettperrno() can be used to get the error condition.
Upon failure, tppost sets tperrno to one of the following values. (Unless otherwise
noted, failure does not affect the caller's transaction, if one exists.)int tpnotify(CLIENTID cltid, weblogic.wtc.jatmi.TypedBuffer data, long flags) throws TuxATMITPException
cltid
- It is a CLIETNID object got from the TPSVCINFO request object
of a previous or current service invocation.data
- A valid typed buffer object.flags
- The following is a list of valid flags:TuxATMITPException
- Upon failure, tpnotify() throws TuxATMITPException, and
TuxATMITPException.gettperrno() can be used to get the error condition;
TuxATMITPException.gettperrordetail() can be used to get the detail error description.int tpbroadcast(java.lang.String lmid, java.lang.String usrname, java.lang.String cltname, weblogic.wtc.jatmi.TypedBuffer data, long flags) throws TuxATMITPException
tpbroadcast
is used by a client or server to send an unsolicited message to
registered clients within the system.
The target client set consists of those clients matching identifiers passed to tpbroadcast().lmid
- logic identifier used to select the target logic machine.usrname
- logic identifier used to select the target user by name.cltname
- logic identifier used to select the target client by name.data
- It is a valid typed buffer object.flags
- The following is a list of valid flags:TuxATMITPException
- Upon failure, tpbroadcast throws TuxATMITPException, and
TuxATMITPException.gettperrno() can be used to get the error condition.int tpenqueue(java.lang.String qspace, java.lang.String qname, TPQCTL ctl, weblogic.wtc.jatmi.TypedBuffer data, long flags) throws TuxATMITPException
tpenqueue
method can be used to store a message on the queue named by qname
in qspace queue space.qspace
- and qname A queue space is a collection of queues, one of which
must be qname.ctl
- It is a TPQCTL control object that is used by the
application programs to pass and retrieve parameters
associated with enqueuing the message.data
- It is a typed buffer object; if it is null, no data part
is enqueued into the queue.flags
- The following is a list of valid flags:TuxATMITPException
- Upon failure, tpenqueue() throws TuxATMITPException
exception, and TuxATMITPException.gettperrno() method can be used to get the
error condition.TuxATMIReply tpdequeue(java.lang.String qspace, java.lang.String qname, TPQCTL ctl, long flags) throws TuxATMITPException
tpdequeue
method can be used to take a message for processing
from the queue named by qname in the qspace queue space.qspace
- and A queue space is a collection of queues, one of which
qname must be qname.ctl
- It is a TPQCTL control object.flags
- The following is a list of valid flags:TuxATMITPException
- Upon failure, tpdequeue() throws TuxATMITPException,
and TuxATMITPException.gettperrno() can be used to get the error
condition.
tpacall
with TPNOTRAN,TPNOBLOCK, and
TPNOREPLY set). When a service fails inside a transaction, the transaction
is put into the TX_ROLLBACK_ONLY state. This state is treated,
for most purposes, as though it were equivalent to a timeout.
All further ATMI calls for this transaction (with the exception of those
issued in the circumstances described in the previous paragraph) will
fail with TPETIME.
int tpsblktime(int blktime, long flags) throws TuxATMITPException
tpsblktime
method can be used to set the blocktime value, in seconds or milliseconds,
of a potential blocking application API method.blktime
- flags
- The following is a list of valid flags:TuxATMITPException
- Upon failure, tpsblktime() throws TuxATMITPException, and
TuxATMITPException.gettperrno() can be used to get real error condition. Upon failure,
tpsblktime() sets tperrno to one of the following values:int tpgblktime(long flags) throws TuxATMITPException
tpgblktime
tpgblktime retrieves a previously set blocktime value, per second or
millisecond according to flag TPBLK_MILLISECOND.flags
- The following is a list of valid flags:TuxATMITPException
- - Upon failure, tpgblktime() throws a TuxATMITPException exception,
and TuxATMITPException.gettperrno() can be used to get real error condition.int tpsprio(int prio, long flags) throws TuxATMITPException
tpsprio
tpsprio sets the priority for the next request sent or forwarded by the
current thread in the current context. The priority set affects only the next request sent.
Priority can also be set for messages enqueued or dequeued by tpenqueue() or tpdequeue(),
if the queued message facility is installed. By default, the setting of prio increments or
decrements a service's default priority up to a maximum of 100 or down to a minimum of 1,
depending on its sign, where 100 is the highest priority. The default priority for a request
is determined by the service to which the request is being sent. This default may be specified
administratively (see UBBCONFIG(5)), or take the system default of 50.prio
- The priority value.flags
- The following is a list of valid flags:TuxATMITPException
- Upon failure, and TuxATMITPException.gettperrno() can be used to get real
error conditionint tpgprio() throws TuxATMITPException
tpgprio
tpgprio() returns the priority for the last request sent or received
by the current thread in its current context. Priorities can range from 1 to 100, inclusive,
with 100 being the highest priority. tpgprio may be called after tpcall or tpacall, (also
tpenqueue(), or tpdequeue(), assuming the queued management facility is installed), and
the priority returned is for the request sent. Also, tpgprio() may be called within a
service routine to find out at what priority the invoked service was sent. tpgprio()
may be called any number of times and will return the same value until the next request is sent.TuxATMITPException
- Upon failure, and TuxATMITPException.gettperrno() can be used to get real
error conditionweblogic.wtc.jatmi.TypedFML tpxmltofml(weblogic.wtc.jatmi.TypedXML xmldata, java.lang.String xfile, java.lang.String rtag, long flags) throws TuxATMITPException
tpxmltofml
tpxmltofml method can be used to convert a TypedXML object to
TypedFML object.xmldata
- It is a TypedXML object.xfile
- It is the fully qualified path name of an XML schema file used to validate XML input.rtag
- It is current unused.flags
- They are bit values used in the method to map to the XML parser classes.
The following is a list of valid XML parser flags:TuxATMITPException
- Upon failure, tpxmltofml() throws a TuxATMITPException
exception, and TuxATMITPException.gettperrno() can be used to get the real error condition.
The function may fail for the following reasons.weblogic.wtc.jatmi.TypedFML32 tpxmltofml32(weblogic.wtc.jatmi.TypedXML xmldata, java.lang.String xfile, java.lang.String rtag, long flags) throws TuxATMITPException
tpxmltofml32
tpxmltofml32 method can be used to convert a TypedXML object to
TypedFML32 object.xmldata
- It is a TypedXML object.xfile
- It is the fully qualified path name of an XML schema file used to validate XML input.rtag
- It is current unused.flags
- They are bit values used in the method to map to the XML parser classes.
The following is a list of valid XML parser flags:TuxATMITPException
- Upon failure, tpxmltofml32 throws a TuxATMITPException
exception, and TuxATMITPException.gettperrno() can be used to get the real error condition.
The function may fail for the following reasons.weblogic.wtc.jatmi.TypedXML tpfml32toxml(weblogic.wtc.jatmi.TypedFML32 fmldata, java.lang.String xfile, java.lang.String rtag, long flags) throws TuxATMITPException
tpfml32toxml
tpfml32toxml is used to convert a TypedFML32 object to a TypedXML object.fmldata
- It is a valid TypedFML32 typed buffer object.xfile
- It is currently unused and reserved.rtag
- If present, it is the root element name of converted xml data.flags
- It is currently reserved for future use.TuxATMITPException
- Upon failure, tpfml32toxml throws a TuxATMITPException exception,
and TuxATMITPException.gettperrno() can be used to get the real error condition.weblogic.wtc.jatmi.TypedXML tpfmltoxml(weblogic.wtc.jatmi.TypedFML fmldata, java.lang.String xfile, java.lang.String rtag, long flags) throws TuxATMITPException
tpfmltoxml
tpfmltoxml is used to convert a TypedFML object to a TypedXML object.fmldata
- It is a valid TypedFML typed buffer object.xfile
- It is currently unused and reserved.rtag
- If present, it is the root element name of converted xml data.flags
- It is currently reserved for future use.TuxATMITPException
- Upon failure, tpfmltoxml throws a TuxATMITPException exception,
and TuxATMITPException.gettperrno() can be used to get the real error condition.int tpbegin(long trntime, long flags) throws TuxATMITPException
tpbegin()
signifies the beginning of a transaction.
A transaction in the Oracle Tuxedo ATMI system is used to define a single logical
unit of work that either wholly succeeds or has no effect whatsoever. A transaction
allows work being performed in many processes, at possibly different sites, to be treated
as an atomic unit of work.The initiator of a transaction uses tpbegin()
and either tpcommit()
or tpabort()
to delineate the operations
within a transaction. Once tpbegin()
is called, communication with any other
program can place the latter (of necessity, a server) in "transaction mode" (that is, the server's
work becomes part of the transaction). Programs that join a transaction are called participants.
A transaction always has one initiator and can have several participants. Only the initiator of a
transaction can call tpcommit()
or tpabort()
. Participants can
influence the outcome of a transaction by the return values (rvals) they use when they call tpreturn().
Once in transaction mode, any service requests made to servers are processed on behalf of the transaction
(unless the requester explicitly specifies otherwise).trntime
- Specifies that the transaction should be allowed at least timeout seconds before
timing out. Once a transaction times out it must be marked abort-only.
If timeout is 0, then the transaction is given the maximum number of seconds allowed by the system
before timing out (that is, the timeout value equals the maximum value for an unsigned long as definedflags
- It is reserved for future use and must be set to 0.tpbegin()
returns -1.TuxATMITPException
- Upon failure tpbegin
sets tperrno in TuxATMITPException
to one of the following values. flags
is not equal to 0.
tpbegin()
was called in an improper context
(for example, the caller is already in transaction mode).
Notices
When using tpbegin()
, andtpcommit()
, and tpabort()
,
to delineate an Oracle Tuxedo ATMI system transaction, it is important to remember that only
the work done by a resource manager that meets the XA interface
(and is linked to the caller appropriately) has transactional properties.
All other operations performed in a transaction are not affected by either tpcommit()
or tpabort()
.
int tpcommit(long flags) throws TuxATMITPException
tpcommit()
signifies the end of a transaction,
using a two-phase commit protocol to coordinate participants. tpcommit() can be called only by the
initiator of a transaction. If any of the participants cannot commit the transaction
(for example, they call tpreturn() with TPFAIL), then the entire transaction is aborted and tpcommit() fails.
That is, all of the work involved in the transaction is undone. If all participants agree to commit their
portion of the transaction, then this decision is logged to stable storage and all participants are asked
to commit their work.
Depending on the setting of the TP_COMMIT_CONTROL characteristic, tpcommit() can return
successfully either after the commit decision has been logged or after the two-phase commit
protocol has completed.
If tpcommit()
returns after the commit decision has been logged but before the second phase
has completed (TP_CMT_LOGGED), then all participants have agreed to commit the work they did on
behalf of the transaction and should fulfill their promise to commit the transaction during the second
phase. However, because tpcommit()
is returning before the second phase has completed,
there is a hazard that one or more of the participants can heuristically complete their portion of the
transaction (in a manner that is not consistent with the commit decision) even though the function
has returned success. If the TP_COMMIT_CONTROL characteristic is set such that tpcommit()
returns after the two-phase commit protocol has completed (TP_CMT_COMPLETE),
then its return value reflects the exact status of the transaction (that is, whether the transaction
heuristically completed or not).
Currently TP_COMMIT_CONTROL is set to the default value TP_CMT_LOGGED.
So tpcommit()
returns after the commit decision has been logged but
before the second phase has completed (TP_CMT_LOGGED).
Note that if only a single resource manager is involved in a transaction, then a one-phase commit
is performed (that is, the resource manager is not asked whether or not it can commit;
it is simply told to commit). In this case, the TP_COMMIT_CONTROL characteristic has no bearing
and tpcommit()
will return heuristic outcomes if present.
If tpcommit()
is called while call descriptors exist for outstanding replies,
then upon return from the function, the transaction is aborted and those descriptors associated
with the caller's transaction are no longer valid. Call descriptors not associated with the caller's
transaction remain valid.
flags
- It reserved for future use and must be set to 0.tpcommit()
returns -1.TuxATMITPException
- Upon failure tpcommit
sets tperrno in TuxATMITPException
to one of the following values. tpcommit()
is called with outstanding replies or open conversational connections.
flags
is not equal to 0. The caller's transaction is not affected.
tpcommit()
was called in an improper context
(for example, by a participant).
TPEABORT
is returned.
Notices
When using tpbegin()
, tpcommit()
, and tpabort()
,
to delineate an Oracle Tuxedo ATMI system transaction, it is important to remember that only
the work done by a resource manager that meets the XA interface
(and is linked to the caller appropriately) has transactional properties.
All other operations performed in a transaction are not affected by either tpcommit()
or tpabort()
.
int tpabort(long flags) throws TuxATMITPException
tpabort()
signifies the abnormal end of a transaction.
When this call returns, all changes made to resources during the transaction are undone.
Like tpcommit(), this function can be called only by the initiator of a transaction.
Participants (that is, service routines) can express their desire to have a transaction aborted
by calling tpreturn() with TPFAIL.
If tpabort()
is called while call descriptors exist for outstanding replies,
then upon return from the function, the transaction is aborted and those descriptors associated
with the caller's transaction are no longer valid. Call descriptors not associated with the caller's
transaction remain valid.
flags
- It is reserved for future use and should be set to 0.tpabort()
returns -1.TuxATMITPException
- Upon failure tpabort
sets tperrno in TuxATMITPException
to one of the following values. flags
is not equal to 0. The caller's transaction is not affected.
tpabort()
was called improperly (for example, by a participant).
Notices
When using tpbegin()
, tpcommit()
, and tpabort()
,
to delineate an Oracle Tuxedo ATMI system transaction, it is important to remember that only
the work done by a resource manager that meets the XA interface
(and is linked to the caller appropriately) has transactional properties.
All other operations performed in a transaction are not affected by either tpcommit()
or tpabort()
.
TPTRANID tpsuspend(long flags) throws TuxATMITPException
tpsuspend
tpsuspend() is used to suspend the transaction active in the caller's
process. To ensure success, the caller must have completed all outstanding transactional
communication with servers before issuing tpsuspend. That is, the caller must have
received all replies for requests sent with tpacall that were associated with the caller's
transaction. Also, the caller must have closed all connections with conversational services
associated with the caller's transaction (that is, tprecv() must have returned the
TPEV_SVCSUCC event). If either rule is not followed, then tpsuspend() fails, the caller's
current transaction is not suspended and all transactional communication descriptors remain
valid. Communication descriptors not associated with the caller's transaction remain valid
regardless of the outcome of tpsuspend.flags
- It is reserved for future use and must be set to 0.TuxATMITPException
- Upon failure, tpsuspend() throws a TuxATMITPException exception.int tpresume(TPTRANID trnId, long flags) throws TuxATMITPException
tpresume()
tpresume is used to resume work on behalf of a previously
suspended transaction.trnId
- It is a valid TPTRANID object returned by previously invoking tpsuspend() method.flags
- It is reserved for future use and must be set to 0.TuxATMITPException
- Upon failure, tpresume() throws a TuxATMITPException exception.
TuxATMITPException.gettperrno() can be used to get real error condition. Under the following
conditions, tpresume() fails and sets tperrno to:int tpgetlev() throws TuxATMITPException
tpgetlev()
returns the current transaction level to the caller.
Currently, the only levels defined are 0 and 1.tpgetlev()
returns either a 0 to indicate
that no transaction is in progress, or 1 to indicate that a transaction is in progress; Upon failure,
tpgetlev() returns -1TuxATMITPException
- Upon failure tpgetlev
sets tperrno in TuxATMITPException
to one of the following values. tpgetlev()
was called improperly.
Notices
When using tpbegin()
, tpcommit()
, and tpabort()
,
to delineate an Oracle Tuxedo ATMI system transaction, it is important to remember that only
the work done by a resource manager that meets the XA interface
(and is linked to the caller appropriately) has transactional properties.
All other operations performed in a transaction are not affected by either tpcommit()
or tpabort()
.
int tpscmt(long flags) throws TuxATMITPException
tpscmt
tpscmt method sets the TP_COMMIT_CONTROL characteristic to the value
specified in flags.flags
- The following is a list of valid flags:TuxATMITPException
- Upon failure, tpscmt() throws a TuxATMITPException exception.
Upon failure, tpscmt() sets tperrno to one of the following values, TuxATMITPException.gettperno()
can be used to retrieve the real error condition: