* @param xid a XID
* @param onePhase true if onePhase, false otherwise
* @throws XAException when an error occurs
*/
public void commitInternal(Xid xid, boolean onePhase) throws XAException {
LiveCacheStatisticsWrapper liveCacheStatisticsWrapper = (LiveCacheStatisticsWrapper) cache.getLiveCacheStatistics();
liveCacheStatisticsWrapper.xaCommit();
if (onePhase) {
XATransactionContext twopcTransactionContext = xidToContextMap.get(xid);
if (twopcTransactionContext == null) {
throw new EhcacheXAException("cannot call commit(onePhase=true) after prepare", XAException.XAER_PROTO);
}