public class XAResourceMngr extends Object
Modifier and Type | Field and Description |
---|---|
(package private) Connection |
cnx
The connection this manager belongs to.
|
private static org.objectweb.util.monolog.api.Logger |
logger |
static int |
PREPARED
Prepared transaction.
|
static int |
ROLLBACK_ONLY
Failed transaction.
|
(package private) Hashtable |
sessionTable
table of Session (key Xid).
|
static int |
STARTED
Transaction active.
|
static int |
SUCCESS
Transaction successful.
|
static int |
SUSPENDED
Transaction suspended.
|
private Hashtable |
transactions
The table of known transactions.
|
Constructor and Description |
---|
XAResourceMngr(Connection cnx)
Creates a
XAResourceMngr instance. |
Modifier and Type | Method and Description |
---|---|
(package private) void |
commit(Xid xid)
Notifies the RM that a transaction is commited.
|
(package private) void |
end(Xid xid,
int flag,
Session sess)
Notifies the RM that a transaction is ended.
|
boolean |
equals(Object o)
Resource managers are equal if they belong to the same connection.
|
private int |
getStatus(Xid xid)
Gets the status of a transaction.
|
int |
hashCode() |
(package private) void |
prepare(Xid xid)
Notifies the RM that a transaction is prepared.
|
(package private) Xid[] |
recover(int flag)
Notifies the RM to recover the prepared transactions.
|
(package private) void |
rollback(Xid xid)
Notifies the RM that a transaction is rolled back.
|
private void |
setStatus(Xid xid,
int status)
Sets the status of a transaction.
|
(package private) void |
start(Xid xid,
int flag,
Session sess)
Notifies the RM that a transaction is starting.
|
public static final int STARTED
public static final int SUSPENDED
public static final int SUCCESS
public static final int ROLLBACK_ONLY
public static final int PREPARED
private static org.objectweb.util.monolog.api.Logger logger
private Hashtable transactions
Key: transaction identifier
Object: XAContext
instance
Connection cnx
Hashtable sessionTable
public XAResourceMngr(Connection cnx)
XAResourceMngr
instance.cnx
- The connection this manager belongs to.void start(Xid xid, int flag, Session sess) throws XAException
XAException
- If the specified transaction is already known by
the RM in an incompatible state with the start
request.void end(Xid xid, int flag, Session sess) throws XAException
XAException
- If the specified transaction is in an
incompatible state with the end request.void prepare(Xid xid) throws XAException
XAException
- If the specified transaction is in an
incompatible state with the prepare request,
or if the request fails.void commit(Xid xid) throws XAException
XAException
- If the specified transaction is in an
incompatible state with the commit request,
or if the request fails.void rollback(Xid xid) throws XAException
XAException
- If the specified transaction is in an
incompatible state with the rollback request,
or if the request fails.Xid[] recover(int flag) throws XAException
XAException
- If the specified flag is invalid, or if the
request fails.private void setStatus(Xid xid, int status) throws XAException
XAException
- If the transaction is unknown.private int getStatus(Xid xid) throws XAException
XAException
- If the transaction is unknown.public boolean equals(Object o)
Copyright © 2020 ScalAgent D.T.. All rights reserved.