本文整理匯總了Java中javax.transaction.xa.XAException.XAER_PROTO屬性的典型用法代碼示例。如果您正苦於以下問題:Java XAException.XAER_PROTO屬性的具體用法?Java XAException.XAER_PROTO怎麽用?Java XAException.XAER_PROTO使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類javax.transaction.xa.XAException
的用法示例。
在下文中一共展示了XAException.XAER_PROTO屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: end
/**
* Preconditions: 1. Flags is one of TMSUCCESS, TMFAIL, TMSUSPEND 2. xid !=
* null 3. Connection is associated with transaction xid
*
* Implementation deficiency preconditions: 1. Flags is not TMSUSPEND
*
* Postconditions: 1. connection is disassociated from the transaction.
*
* @see XAResource#end(Xid, int)
*/
@Override
public void end(Xid xid, int flags) throws XAException
{
if (logger.logDebug())
{
debug("ending transaction xid = " + xid);
}
// Check preconditions
if (flags != XAResource.TMSUSPEND && flags != XAResource.TMFAIL && flags != XAResource.TMSUCCESS)
{
throw new CloudSpannerXAException("Invalid flags", Code.INVALID_ARGUMENT, XAException.XAER_INVAL);
}
if (xid == null)
{
throw new CloudSpannerXAException("xid must not be null", Code.INVALID_ARGUMENT, XAException.XAER_INVAL);
}
if (state != STATE_ACTIVE || !currentXid.equals(xid))
{
throw new CloudSpannerXAException("tried to call end without corresponding start call",
Code.FAILED_PRECONDITION, XAException.XAER_PROTO);
}
// Check implementation deficiency preconditions
if (flags == XAResource.TMSUSPEND)
{
throw new CloudSpannerXAException("suspend/resume not implemented", Code.UNIMPLEMENTED,
XAException.XAER_RMERR);
}
// We ignore TMFAIL. It's just a hint to the RM. We could roll back
// immediately
// if TMFAIL was given.
// All clear. We don't have any real work to do.
state = STATE_ENDED;
}