Methods Summary |
---|
public void | begin()
synchronized (stateLock)
{
if (inManagedTransaction == false)
{
try
{
if (underlyingAutoCommit)
{
underlyingAutoCommit = false;
con.setAutoCommit(false);
}
checkState();
inManagedTransaction = true;
}
catch (SQLException e)
{
checkException(e);
}
}
else
throw new JBossResourceException("Trying to begin a nested local tx");
}
|
protected void | broadcastConnectionError(java.sql.SQLException e)
super.broadcastConnectionError(e);
|
public void | commit()
synchronized (stateLock)
{
if (inManagedTransaction)
inManagedTransaction = false;
}
try
{
con.commit();
}
catch (SQLException e)
{
checkException(e);
}
|
public void | commit(javax.transaction.xa.Xid xid, boolean onePhase)
xaResource.commit(xid, onePhase);
|
public void | destroy()
try
{
super.destroy();
}
finally
{
try
{
xaConnection.close();
}
catch (SQLException e)
{
checkException(e);
}
}
|
public void | end(javax.transaction.xa.Xid xid, int flags)
try
{
xaResource.end(xid, flags);
}catch(XAException e)
{
getLog().error("End transaction failed for XAResource", e);
broadcastConnectionError(e);
throw e;
}
//we want to allow ending transactions that are not the current
//one. When one does this, inManagedTransaction is still true.
synchronized (stateLock)
{
if (currentXid != null && currentXid.equals(xid))
{
inManagedTransaction = false;
currentXid = null;
}
}
|
public void | forget(javax.transaction.xa.Xid xid)
xaResource.forget(xid);
|
public javax.resource.spi.LocalTransaction | getLocalTransaction()
return this;
|
java.util.Properties | getProps()
return props;
|
public int | getTransactionTimeout()
return xaResource.getTransactionTimeout();
|
public javax.transaction.xa.XAResource | getXAResource()
return this;
|
private boolean | isFailedXA(int errorCode)
return (errorCode == XAException.XAER_RMERR || errorCode == XAException.XAER_RMFAIL);
|
public boolean | isSameRM(javax.transaction.xa.XAResource other)
// compare apples to apples
return (other instanceof XAManagedConnection)
? xaResource.isSameRM(((XAManagedConnection) other).xaResource)
: xaResource.isSameRM(other);
|
public int | prepare(javax.transaction.xa.Xid xid)
return xaResource.prepare(xid);
|
public javax.transaction.xa.Xid[] | recover(int flag)
return xaResource.recover(flag);
|
public void | rollback(javax.transaction.xa.Xid xid)
xaResource.rollback(xid);
|
public void | rollback()
synchronized (stateLock)
{
if (inManagedTransaction)
inManagedTransaction = false;
}
try
{
con.rollback();
}
catch (SQLException e)
{
try
{
checkException(e);
}
catch (Exception e2)
{
}
}
|
public boolean | setTransactionTimeout(int seconds)
return xaResource.setTransactionTimeout(seconds);
|
public void | start(javax.transaction.xa.Xid xid, int flags)
try
{
checkState();
}
catch (SQLException e)
{
getLog().warn("Error setting state ", e);
}
try
{
xaResource.start(xid, flags);
}catch(XAException e)
{
//JBAS-3336 Connections that fail in enlistment should not be returned
//to the pool
if(isFailedXA(e.errorCode))
{
getLog().error("Start transaction failed for " + this);
broadcastConnectionError(e);
}
throw e;
}
synchronized (stateLock)
{
currentXid = xid;
inManagedTransaction = true;
}
|