本文整理匯總了Java中javax.transaction.xa.XAResource.TMJOIN屬性的典型用法代碼示例。如果您正苦於以下問題:Java XAResource.TMJOIN屬性的具體用法?Java XAResource.TMJOIN怎麽用?Java XAResource.TMJOIN使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類javax.transaction.xa.XAResource
的用法示例。
在下文中一共展示了XAResource.TMJOIN屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: start
public void start(Xid xid, int arg1) throws XAException {
switchToXid(xid);
if (arg1 != XAResource.TMJOIN) {
this.currentXAResource.start(xid, arg1);
return;
}
//
// Emulate join, by using resume on the same physical connection
//
this.currentXAResource.start(xid, XAResource.TMRESUME);
}
示例2: start
public void start(Xid xid, int flag) throws XAException
{
Map<StoreRef, LuceneIndexer> active = activeIndexersInGlobalTx.get(xid);
Map<StoreRef, LuceneIndexer> suspended = suspendedIndexersInGlobalTx.get(xid);
if (flag == XAResource.TMJOIN)
{
// must be active
if ((active != null) && (suspended == null))
{
return;
}
else
{
throw new XAException("Trying to rejoin transaction in an invalid state");
}
}
else if (flag == XAResource.TMRESUME)
{
// must be suspended
if ((active == null) && (suspended != null))
{
suspendedIndexersInGlobalTx.remove(xid);
activeIndexersInGlobalTx.put(xid, suspended);
return;
}
else
{
throw new XAException("Trying to rejoin transaction in an invalid state");
}
}
else if (flag == XAResource.TMNOFLAGS)
{
if ((active == null) && (suspended == null))
{
return;
}
else
{
throw new XAException("Trying to start an existing or suspended transaction");
}
}
else
{
throw new XAException("Unkown flags for start " + flag);
}
}