Method from org.apache.derby.jdbc.ResourceAdapterImpl Detail: |
public synchronized boolean addConnection(XAXactId xid,
Object conn) {
if (connectionTable.get(xid) != null)
return false;
// put this into the transaction table, if the xid is already
// present as an in-doubt transaction, we need to remove it from
// the run time list
connectionTable.put(xid, conn);
return true;
}
|
public void boot(boolean create,
Properties properties) throws StandardException {
// we can only run on jdk1.2 or beyond with JTA and JAVA 20 extension
// loaded.
connectionTable = new Hashtable();
AccessFactory af =
(AccessFactory)Monitor.findServiceModule(this, AccessFactory.MODULE);
rm = (XAResourceManager) af.getXAResourceManager();
active = true;
}
|
public void cancelXATransaction(XAXactId xid,
String messageId) throws XAException {
XATransactionState xaState = (XATransactionState) findConnection(xid);
if (xaState != null) {
xaState.cancel(messageId);
}
}
|
public synchronized Object findConnection(XAXactId xid) {
return connectionTable.get(xid);
}
|
public XAResourceManager getXAResourceManager() {
return rm;
}
Return the XA Resource manager to the XA Connection |
public boolean isActive() {
return active;
}
|
public synchronized Object removeConnection(XAXactId xid) {
return connectionTable.remove(xid);
}
|
public void stop() {
active = false;
for (Enumeration e = connectionTable.elements(); e.hasMoreElements(); ) {
XATransactionState tranState = (XATransactionState) e.nextElement();
try {
tranState.conn.close();
} catch (java.sql.SQLException sqle) {
}
}
active = false;
}
|