Methods Summary |
---|
public void | begin(int timeout)
//START RI PERFIMPROVEMENT
/***
// Just to tell that, use this timeout for the transaction, there is no need
// to synchronized and thus serrialize the activity. Now this is avoided by
// the introduction of two new methods begin(timeout) in TransactionManagerImpl
// and CurrentImpl
// ensure no other thread change the timeout
synchronized(tm) {
tm.setTransactionTimeout(timeout);
tm.begin();
tm.setTransactionTimeout(0);
// START IASRI 4662745
if (monitoringEnabled) {
Transaction tran = tm.getTransaction();
activeTransactions.addElement(tran);
m_transInFlight++;
}
// END IASRI 4662745
}
**/
((TransactionManagerImpl)tm).begin(timeout);
// START IASRI 4662745
if (monitoringEnabled) {
Transaction tran = tm.getTransaction();
activeTransactions.addElement(tran);
m_transInFlight++;
}
// END IASRI 4662745
//END RI PERFIMPROVEMENT
|
public void | begin()/
/**
Create a new transaction and associate it with the current thread.
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE,"TM: begin");
//START RI PERFIMPROVEMENT
/***
// Just to tell that, use this timeout for the transaction, there is no need
// to synchronize and thus serrialize the activity. Now this is avoided by
// the introduction of two new methods begin(timeout) in TransactionManagerImpl
// and CurrentImpl
synchronized(tm) {
// ensure no other thread change the timeout
tm.setTransactionTimeout(transactionTimeout);
tm.begin();
tm.setTransactionTimeout(0);
// START IASRI 4662745
if (monitoringEnabled) {
Transaction tran = tm.getTransaction();
activeTransactions.addElement(tran);
m_transInFlight++;
}
// END IASRI 4662745
}
***/
((TransactionManagerImpl)tm).begin(getEffectiveTimeout());
// START IASRI 4662745
if (monitoringEnabled) {
Transaction tran = tm.getTransaction();
activeTransactions.addElement(tran);
m_transInFlight++;
}
// END IASRI 4662745
// END IASRI PERFIMPROVEMENT
|
public void | checkTransactionExport(boolean isLocal)
|
public void | checkTransactionImport()
|
public void | cleanTxnTimeout()
txnTmout.set(null);
|
public void | commit()Complete the transaction associated with the current thread. When this
method completes, the thread becomes associated with no transaction.
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE,"TM: commit");
validateTransactionManager();
Object obj = null;
if(monitoringEnabled){
obj = tm.getTransaction();
}
if (invMgr.isInvocationStackEmpty()) {
try{
tm.commit();
if (monitoringEnabled){
monitorTxCompleted(obj, true);
}
}catch(RollbackException e){
if (monitoringEnabled){
monitorTxCompleted(obj, false);
}
throw e;
}catch(HeuristicRollbackException e){
if (monitoringEnabled){
monitorTxCompleted(obj, false);
}
throw e;
}catch(HeuristicMixedException e){
if (monitoringEnabled){
monitorTxCompleted(obj, true);
}
throw e;
}
} else {
ComponentInvocation curr = null;
try {
curr = invMgr.getCurrentInvocation();
if (curr != null)
curr.setTransactionCompeting(true);
tm.commit();
if (monitoringEnabled){
monitorTxCompleted(obj, true);
}
} catch (InvocationException ex) {
assert false;
}catch(RollbackException e){
if (monitoringEnabled){
monitorTxCompleted(obj, false);
}
throw e;
}catch(HeuristicRollbackException e){
if (monitoringEnabled){
monitorTxCompleted(obj, false);
}
throw e;
}catch(HeuristicMixedException e){
if (monitoringEnabled){
monitorTxCompleted(obj, true);
}
throw e;
} finally {
if (curr != null) {
curr.setTransactionCompeting(false);
}
}
}
|
public void | componentDestroyed(java.lang.Object instance)
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE,"TM: componentDestroyed" + instance);
// START IASRI 4705808 TTT002 -- use List instead of Vector
// Mod: remove the bad behavior of adding an empty list then remove it
List l = (List)resourceTable.get(getInstanceKey(instance));
if (l != null && l.size() > 0) {
//START IASRI 4720840
resourceTable.remove(getInstanceKey(instance));
//END IASRI 4720840
Iterator it = l.iterator();
while (it.hasNext()) {
ResourceHandle h = (ResourceHandle) it.next();
try {
h.getResourceAllocator().closeUserConnection(h);
} catch (PoolingException ex) {
/** IASRI 4664284
if (debug) ex.printStackTrace();
**/
// START OF IASRI 4664284
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.WARNING,"enterprise_distributedtx.pooling_excep", ex);
// END OF IASRI 4664284
}
}
l.clear();
//START IASRI 4720840
// resourceTable.remove(getInstanceKey(instance));
//END IASRI 4720840
}
// END IASRI 4705808 TTT002
|
public static void | createJTSTransactionManager()
// It is assumed that transaction manager is already created
// and is available in switch.
J2EETransactionManagerImpl impl = (J2EETransactionManagerImpl)
Switch.getSwitch().getTransactionManager();
if (impl.tm != null)
return;
impl.tm = TransactionManagerImpl.getTransactionManagerImpl();
|
public static J2EETransactionManager | createTransactionManager()
ServerConfiguration sc = ServerConfiguration.getConfiguration();
String txOpt = sc.getProperty(TX_OPT);
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE,"TM: Tx Opt = " + txOpt);
J2EETransactionManager j2eeTM;
if ( txOpt != null && txOpt.equals("false") )
j2eeTM = new J2EETransactionManagerImpl();
else {
j2eeTM = new J2EETransactionManagerOpt();
J2EETransaction.j2eeTM = (J2EETransactionManagerOpt)j2eeTM;
}
return j2eeTM;
|
public void | delistComponentResources(boolean suspend)
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE,"TM: delistComponentResources");
ComponentInvocation inv = invMgr.getCurrentInvocation();
// BEGIN IASRI# 4646060
if (inv == null) {
return;
}
// END IASRI# 4646060
try {
delistComponentResources(inv, suspend);
} catch (InvocationException ex) {
/** IASRI 4664284
ex.printStackTrace();
ex.printStackTrace(Log.err);
**/
// START OF IASRI 4664284
_logger.log(Level.SEVERE,"enterprise_distributedtx.excep_in_delist",ex);
// END OF IASRI 4664284
throw new RemoteException("", ex.getNestedException());
} catch (Exception ex) {
/** IASRI 4664284
ex.printStackTrace();
ex.printStackTrace(Log.err);
**/
// START OF IASRI 4664284
_logger.log(Level.SEVERE,"enterprise_distributedtx.excep_in_delist",ex);
// END OF IASRI 4664284
throw new RemoteException("", ex);
}
|
private void | delistComponentResources(ComponentInvocation inv, boolean suspend)
try {
Transaction tran = inv.getTransaction();
if (isTransactionActive(tran)) {
/** IASRI 4658504
Vector v = getResourceList(inv.getInstance());
Enumeration e = v.elements();
int flag = XAResource.TMSUCCESS;
if (suspend) flag = XAResource.TMSUSPEND;
while (e.hasMoreElements()) {
ResourceHandle h = (ResourceHandle) e.nextElement();
try {
delistResource(tran, h, flag);
} catch (IllegalStateException ex) {
// ignore error due to tx time out
} catch (Exception ex) {
handleResourceError(h, ex, tran, inv);
}
}
**IASRI 4658504 **/
List l = getExistingResourceList(inv.getInstance(), inv);
if (l == null || l.size() == 0)
return;
Iterator it = l.iterator();
// END IASRI 4705808 TTT002
int flag = XAResource.TMSUCCESS;
if(suspend)flag = XAResource.TMSUSPEND;
while(it.hasNext()){
ResourceHandle h = (ResourceHandle)it.next();
try{
if ( h.isEnlisted() ) {
delistResource(tran,h,flag);
}
} catch (IllegalStateException ex) {
// ignore error due to tx time out
}catch(Exception ex){
it.remove();
handleResourceError(h,ex,tran,inv);
}
}
//END OF IASRI 4658504
}
} catch (Exception ex) {
/** IASRI 4664284
ex.printStackTrace();
ex.printStackTrace(Log.err);
**/
// START OF IASRI 4664284
_logger.log(Level.SEVERE,"enterprise_distributedtx.excep_in_delist",ex);
// END OF IASRI 4664284
//throw new InvocationException(ex);
}
|
public boolean | delistResource(javax.transaction.Transaction tran, ResourceHandle h, int flag)
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE,"TM: delistResource");
if (!h.isShareable() || multipleEnlistDelists) {
if (h.isTransactional() && h.isEnlisted()) {
return tran.delistResource(h.getXAResource(), flag);
} else {
return true;
}
}
return true;
|
public void | ejbDestroyed(com.sun.ejb.ComponentContext context)
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE, " ejbDestroyed: " + context);
List l = (List)context.getResourceList();
if (l != null && l.size() > 0) {
Iterator it = l.iterator();
while (it.hasNext()) {
ResourceHandle h = (ResourceHandle) it.next();
try {
h.getResourceAllocator().closeUserConnection(h);
} catch (PoolingException ex) {
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.WARNING,"enterprise_distributedtx.pooling_excep", ex);
}
}
l.clear();
}
|
private void | enlistComponentResources(ComponentInvocation inv)
// Exception ex1 = null;
try {
Transaction tran = inv.getTransaction();
if (isTransactionActive(tran)) {
/** IASRI 4658504
Vector v = getResourceList(inv.getInstance());
Enumeration e = v.elements();
while (e.hasMoreElements()) {
ResourceHandle h = (ResourceHandle) e.nextElement();
try {
enlistResource(tran, h);
} catch (Exception ex) {
handleResourceError(h, ex, tran, inv);
}
}
** IASRI 4658504 **/
List l = getExistingResourceList(inv.getInstance(), inv);
if (l == null || l.size() == 0) return;
Iterator it = l.iterator();
// END IASRI 4705808 TTT002
while(it.hasNext()) {
ResourceHandle h = (ResourceHandle) it.next();
try{
enlistResource(tran,h);
}catch(Exception ex){
// ex1 = ex;
it.remove();
handleResourceError(h,ex,tran,inv);
}
}
//END OF IASRI 4658504
}
} catch (Exception ex) {
/** IASRI 4664284
ex.printStackTrace();
ex.printStackTrace(Log.err);
**/
// START OF IASRI 4664284
_logger.log(Level.SEVERE,"enterprise_distributedtx.excep_in_enlist",ex);
// END OF IASRI 4664284
//throw new InvocationException(ex);
}
/**
if (ex1 != null) {
InvocationException ivx = new InvocationException(ex1.getMessage());
ivx.initCause(ex1);
throw ivx;
}
**/
|
public void | enlistComponentResources()
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE,"TM: enlistComponentResources");
ComponentInvocation inv = invMgr.getCurrentInvocation();
if (inv == null)
return;
try {
Transaction tran = getTransaction();
inv.setTransaction(tran);
enlistComponentResources(inv);
} catch (InvocationException ex) {
/** IASRI 4664284
ex.printStackTrace();
ex.printStackTrace(Log.err);
**/
//START OF IASRI 4664284
_logger.log(Level.SEVERE,"enterprise_distributedtx.excep_in_enlist" ,ex);
//END OF IASRI 4664284
throw new RemoteException(ex.getMessage(), ex.getNestedException());
} catch (Exception ex) {
/** IASRI 4664284
ex.printStackTrace();
ex.printStackTrace(Log.err);
**/
//START OF IASRI 4664284
_logger.log(Level.SEVERE,"enterprise_distributedtx.excep_in_enlist" ,ex);
//END OF IASRI 4664284
throw new RemoteException(ex.getMessage(), ex);
}
|
public boolean | enlistLAOResource(javax.transaction.Transaction tran, ResourceHandle h)
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE,"TM: enlistLAOResource");
if (h.isTransactional()) {
XAResource res = h.getXAResource();
boolean result = tran.enlistResource(res);
return result;
} else {
return true;
}
|
public boolean | enlistResource(javax.transaction.Transaction tran, ResourceHandle h)
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE,"TM: enlistResource");
if (h.isTransactional() && (!h.isEnlisted() || !h.isShareable() || multipleEnlistDelists)) {
XAResource res = h.getXAResource();
boolean result = tran.enlistResource(res);
if (!h.isEnlisted())
poolmgr.resourceEnlisted(tran, h);
return result;
} else {
return true;
}
|
public void | forceRollback(javax.transaction.Transaction tran)
if (tran != null){
tran.setRollbackOnly();
}
|
public synchronized void | freeze()
if(com.sun.jts.CosTransactions.AdminUtil.isFrozenAll()){
//multiple freezes will hang this thread, therefore just return
return;
}
com.sun.jts.CosTransactions.AdminUtil.freezeAll();
|
public java.util.ArrayList | getActiveTransactions()
ArrayList tranBeans = new ArrayList();
Vector active = (Vector)activeTransactions.clone(); // get the clone of the active transactions
for(int i=0;i<active.size();i++){
try{
Transaction tran = (Transaction)active.elementAt(i);
String id="unknown";
long startTime = 0;
long elapsedTime = 0;
String status = "unknown";
String componentName = "unknown";
ArrayList<String> resourceNames = null;
if(tran instanceof com.sun.jts.jta.TransactionImpl){
id=((com.sun.jts.jta.TransactionImpl)tran).getTransactionId();
startTime = ((com.sun.jts.jta.TransactionImpl)tran).getStartTime();
}else if(tran instanceof J2EETransaction){
J2EETransaction tran1 = (J2EETransaction)tran;
id=tran1.getTransactionId();
startTime = tran1.getStartTime();
componentName = tran1.getComponentName();
resourceNames = tran1.getResourceNames();
}
elapsedTime = System.currentTimeMillis()-startTime;
status = (String)statusMap.get(new Integer(tran.getStatus()));
TransactionAdminBean tBean = new TransactionAdminBean(tran,id,status,elapsedTime,
componentName, resourceNames);
tranBeans.add(tBean);
}catch(Exception ex){
//LOG !!!
}
}
return tranBeans;
|
int | getEffectiveTimeout()
Integer tmout = txnTmout.get();
if (tmout == null) {
return transactionTimeout;
}
else {
return tmout;
}
|
public java.util.List | getExistingResourceList(java.lang.Object instance)
if (instance == null)
return null;
Object key = getInstanceKey(instance);
if (key == null)
return null;
return (List) resourceTable.get(key);
|
public java.util.List | getExistingResourceList(java.lang.Object instance, ComponentInvocation inv)
if (inv == null)
return null;
List l = null;
if (inv.getInvocationType() == ComponentInvocation.EJB_INVOCATION) {
ComponentContext ctx = inv.context;
if (ctx != null)
l = ctx.getResourceList();
return l;
}
else {
Object key = getInstanceKey(instance);
if (key == null)
return null;
return (List) resourceTable.get(key);
}
|
private java.lang.Object | getInstanceKey(java.lang.Object instance)
Object key = null;
if (instance instanceof Servlet ||
instance instanceof Filter) {
// Servlet or Filter
if (instance instanceof SingleThreadModel) {
key = instance;
} else {
Vector pair = new Vector(2);
pair.addElement(instance);
pair.addElement(Thread.currentThread());
key = pair;
}
} else {
key = instance;
}
return key;
|
public int | getNumberOfActiveTransactions()
return m_transInFlight;
|
public int | getNumberOfTransactionsCommitted()
return m_transCommitted;
|
public int | getNumberOfTransactionsRolledBack()
return m_transRolledback;
|
public java.util.List | getResourceList(java.lang.Object instance)
Object key = getInstanceKey(instance);
List l = (List) resourceTable.get(key);
if (l == null) {
l = new ArrayList(); //FIXME: use an optimum size?
resourceTable.put(key, l);
}
return l;
|
public java.util.List | getResourceList(java.lang.Object instance, ComponentInvocation inv)
if (inv == null)
return new ArrayList(0);
List l = null;
if (inv.getInvocationType() == ComponentInvocation.EJB_INVOCATION) {
ComponentContext ctx = inv.context;
if (ctx != null)
l = ctx.getResourceList();
else {
l = new ArrayList(0);
}
}
else {
Object key = getInstanceKey(instance);
if (key == null)
return new ArrayList(0);
l = (List) resourceTable.get(key);
if (l == null) {
l = new ArrayList(); //FIXME: use an optimum size?
resourceTable.put(key, l);
}
}
return l;
|
public int | getStatus()Obtain the status of the transaction associated with the current thread.
if (tm != null) {
return tm.getStatus();
} else {
return javax.transaction.Status.STATUS_NO_TRANSACTION;
}
|
public javax.transaction.Transaction | getTransaction()Get the transaction object that represents the transaction
context of the calling thread
if (tm == null) {
return null;
} else {
return tm.getTransaction();
}
|
public javax.resource.spi.XATerminator | getXATerminator()Provides a handle to a XATerminator instance. The
XATerminator instance could be used by a resource adapter
to flow-in transaction completion and crash recovery calls from an EIS.
This is used by importing transactions via the Connector contract.
return ((TransactionManagerImpl) tm).getXATerminator();
|
private void | handleResourceError(ResourceHandle h, java.lang.Exception ex, javax.transaction.Transaction tran, ComponentInvocation inv)
if (_logger.isLoggable(Level.FINE)) {
if (h.isTransactional()) {
_logger.log(Level.FINE,"TM: HandleResourceError " +
h.getXAResource() +
"," + ex);
}
}
/** IASRI 4658504
// unregister resource
Object instance = inv.getInstance();
if (instance == null) return;
Vector v = getResourceList(instance);
v.removeElement(h);
** IASRI 4658504 **/
try {
if (tran != null && h.isTransactional() && h.isEnlisted() ) {
tran.delistResource(h.getXAResource(), XAResource.TMSUCCESS);
}
} catch (Exception ex2) {
// ignore
}
if (ex instanceof RollbackException) {
// transaction marked as rollback
return;
} else if (ex instanceof IllegalStateException) {
// transaction aborted by time out
// close resource
try {
h.getResourceAllocator().closeUserConnection(h);
} catch (Exception ex2) {
//Log.err.println(ex2);
}
} else {
// destroy resource. RM Error.
try {
h.getResourceAllocator().destroyResource(h);
} catch (Exception ex2) {
//Log.err.println(ex2);
}
}
|
public synchronized boolean | isFrozen()
return com.sun.jts.CosTransactions.AdminUtil.isFrozenAll();
|
public boolean | isNullTransaction()/
/**
Return true if a "null transaction context" was received
from the client. See EJB2.0 spec section 19.6.2.1.
A null tx context has no Coordinator objref. It indicates
that the client had an active
tx but the client container did not support tx interop.
try {
return com.sun.jts.pi.InterceptorImpl.isTxCtxtNull();
} catch ( Exception ex ) {
// sometimes JTS throws an EmptyStackException if isTxCtxtNull
// is called outside of any CORBA invocation.
return false;
}
|
public boolean | isTimedOut()
com.sun.enterprise.admin.event.AdminEventListenerRegistry.addEventListener(JTSEvent.eventType, new JTSConfigChangeEventListener());
return false;
|
private boolean | isTransactionActive(javax.transaction.Transaction tran)
return (tran != null);
|
protected void | monitorTxCompleted(java.lang.Object tran, boolean committed)
if(tran==null || !activeTransactions.remove(tran)){
// WARN !!!
return;
}
if(committed){
m_transCommitted++;
}else{
m_transRolledback++;
}
m_transInFlight--;
|
public void | postInvoke(ComponentInvocation curr, ComponentInvocation prev)
if ( curr != null && curr.getTransaction() != null )
delistComponentResources(curr, false); // delist with TMSUCCESS
if ( prev != null && prev.getTransaction() != null &&
prev.isTransactionCompleting() == false) {
// do not worry about re-enlisting previous invocation resources
// if transaction is being completed
enlistComponentResources(prev);
}
|
public void | preInvoke(ComponentInvocation prev)
if ( prev != null && prev.getTransaction() != null &&
prev.isTransactionCompleting() == false) {
// do not worry about delisting previous invocation resources
// if transaction is being completed
delistComponentResources(prev, true); // delist with TMSUSPEND
}
|
private static void | print(java.lang.String s)
/** IASRI 4664284
System.err.println(s);
**/
// START OF IASRI 4664284
_logger.log(Level.FINE,s);
// END OF IASRI 4664284
|
public void | recover(javax.transaction.xa.XAResource[] resourceList)
int size = resourceList.length;
Vector v = new Vector();
for (int i=0; i<size; i++) {
v.addElement(resourceList[i]);
}
((TransactionManagerImpl)tm).recover(v.elements());
|
public void | recreate(javax.transaction.xa.Xid xid, long timeout)Recreate a transaction based on the Xid. This call causes the calling
thread to be associated with the specified transaction.
This is used by importing transactions via the Connector contract.
((TransactionManagerImpl) tm).recreate(xid, timeout);
|
public void | registerComponentResource(ResourceHandle h)
ComponentInvocation inv = invMgr.getCurrentInvocation();
if (inv != null) {
Object instance = inv.getInstance();
if (instance == null) return;
h.setComponentInstance(instance);
List l = getResourceList(instance, inv);
l.add(h);
}
|
private void | registerStatisticMonitorTask()
TimerTask task = new StatisticMonitorTask();
Timer timer = Switch.getSwitch().getTimer();
// for now, get monitoring interval from system prop
int statInterval = 2 * 60 * 1000;
try {
String interval
= System.getProperty("MONITOR_JTA_RESOURCE_TABLE_SECONDS");
int temp = Integer.parseInt(interval);
if (temp > 0) {
statInterval = temp;
}
} catch (Exception ex) {
// ignore
}
timer.scheduleAtFixedRate(task, 0, statInterval);
|
public void | registerSynchronization(javax.transaction.Synchronization sync)
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE,"TM: registerSynchronization");
try {
Transaction tran = getTransaction();
if (tran != null) {
tran.registerSynchronization(sync);
}
} catch (RollbackException ex) {
/** IASRI 4664284
ex.printStackTrace();
ex.printStackTrace(Log.err);
**/
//START OF IASRI 4664284
_logger.log(Level.SEVERE,"enterprise_distributedtx.rollbackexcep_in_regsynch",ex);
//END OF IASRI 4664284
throw new IllegalStateException();
}
|
public void | release(javax.transaction.xa.Xid xid)Release a transaction. This call causes the calling thread to be
dissociated from the specified transaction.
This is used by importing transactions via the Connector contract.
((TransactionManagerImpl) tm).release(xid);
|
public void | resume(javax.transaction.Transaction tobj)Resume the transaction context association of the calling thread
with the transaction represented by the supplied Transaction object.
When this method returns, the calling thread is associated with the
transaction context specified.
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE,"TM: resume");
tm.resume(tobj);
|
public void | rollback()Roll back the transaction associated with the current thread. When this
method completes, the thread becomes associated with no transaction.
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE,"TM: rollback");
validateTransactionManager();
// START IASRI 4662745
Object obj = null;
if (monitoringEnabled){
obj = tm.getTransaction();
}
if (invMgr.isInvocationStackEmpty()) {
tm.rollback();
} else {
ComponentInvocation curr = null;
try {
curr = invMgr.getCurrentInvocation();
if (curr != null)
curr.setTransactionCompeting(true);
tm.rollback();
} catch (InvocationException ex) {
assert false;
} finally {
if (curr != null) {
curr.setTransactionCompeting(false);
}
}
}
if (monitoringEnabled){
monitorTxCompleted(obj, false);
}
// END IASRI 4662745
|
public void | setDefaultTransactionTimeout(int seconds)
if (seconds < 0) seconds = 0;
transactionTimeout = seconds;
|
public void | setMonitoringEnabled(boolean enabled)
monitoringEnabled = enabled;
//reset the variables
m_transCommitted = 0;
m_transRolledback = 0;
m_transInFlight = 0;
activeTransactions.removeAllElements();
|
public void | setRollbackOnly()Modify the transaction associated with the current thread such that
the only possible outcome of the transaction is to roll back the
transaction.
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE,"TM: setRollbackOnly");
validateTransactionManager();
tm.setRollbackOnly();
|
public void | setTransactionTimeout(int seconds)Modify the value of the timeout value that is associated with the
transactions started by the current thread with the begin method.
If an application has not called this method, the transaction
service uses some default value for the transaction timeout.
if (seconds < 0) seconds = 0;
txnTmout.set(seconds);
// transactionTimeout = seconds;
|
public javax.transaction.Transaction | suspend()Suspend the transaction currently associated with the calling
thread and return a Transaction object that represents the
transaction context being suspended. If the calling thread is
not associated with a transaction, the method returns a null
object reference. When this method returns, the calling thread
is associated with no transaction.
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE,"TM: suspend");
validateTransactionManager();
return tm.suspend();
|
public synchronized void | unfreeze()
if(com.sun.jts.CosTransactions.AdminUtil.isFrozenAll()){
com.sun.jts.CosTransactions.AdminUtil.unfreezeAll();
}
|
public void | unregisterComponentResource(ResourceHandle h)
Object instance = h.getComponentInstance();
if (instance == null) return;
h.setComponentInstance(null);
ComponentInvocation inv = invMgr.getCurrentInvocation();
List l = null;
if (inv != null)
l = getExistingResourceList(instance, inv);
else
l = getExistingResourceList(instance);
if (l != null) {
l.remove(h);
}
|
private void | validateTransactionManager()
if (tm == null) {
throw new IllegalStateException
(sm.getString("enterprise_distributedtx.transaction_notactive"));
}
|