1 18 package org.ofbiz.entity.transaction; 19 20 import javax.transaction.xa.Xid ; 21 import javax.transaction.xa.XAException ; 22 23 import org.ofbiz.base.util.Debug; 24 25 31 public class DebugXaResource extends GenericXaResource { 32 33 public static final String module = DebugXaResource.class.getName(); 34 public Exception ex = null; 35 36 public DebugXaResource(String info) { 37 this.ex = new Exception (info); 38 } 39 40 public DebugXaResource() { 41 this.ex = new Exception (); 42 } 43 44 public void commit(Xid xid, boolean onePhase) throws XAException { 45 TransactionUtil.debugResMap.remove(xid); 46 if (Debug.verboseOn()) Debug.logVerbose("Xid : " + xid.toString() + " cleared [commit]", module); 47 } 48 49 public void rollback(Xid xid) throws XAException { 50 TransactionUtil.debugResMap.remove(xid); 51 if (Debug.verboseOn()) Debug.logVerbose("Xid : " + xid.toString() + " cleared [rollback]", module); 52 } 53 54 public void enlist() throws XAException { 55 super.enlist(); 56 TransactionUtil.debugResMap.put(xid, this); 57 } 58 59 public void log() { 60 Debug.log("Xid : " + xid, module); 61 Debug.log(ex, module); 62 } 63 } 64 | Popular Tags |