Public Member Functions | |
Rollback (long transactionId) | |
Object | rollback (DistributedRequestManager drm) throws SQLException |
Definition at line 43 of file Rollback.java.
|
Creates a new
Definition at line 53 of file Rollback.java. 00054 {
00055 this.transactionId = transactionId;
00056 }
|
|
Execution of a distributed rollback command on the specified
Definition at line 67 of file Rollback.java. References org.objectweb.cjdbc.common.sql.AbstractRequest.debug(), org.objectweb.cjdbc.controller.requestmanager.TransactionMarkerMetaData.getTransactionId(), and org.objectweb.cjdbc.common.sql.AbstractRequest.setTransactionId(). 00068 { 00069 try 00070 { 00071 Long tid = new Long(transactionId); 00072 TransactionMarkerMetaData tm = drm.getTransactionMarker(tid); 00073 00074 // Wait for the scheduler to give us the authorization to execute 00075 drm.getScheduler().rollback(tm); 00076 00077 if (drm.getLogger().isDebugEnabled()) 00078 drm.getLogger().debug(Translate.get("transaction.rollback", "" + tid)); 00079 00080 try 00081 { 00082 // Send to load balancer 00083 drm.getLoadBalancer().rollback(tm); 00084 00085 // Notify the cache 00086 if (drm.getResultCache() != null) 00087 drm.getResultCache().rollback(tm.getTransactionId()); 00088 00089 // Notify the recovery log manager 00090 if (drm.getRecoveryLog() != null) 00091 drm.getRecoveryLog().rollback(tm); 00092 } 00093 catch (SQLException e) 00094 { 00095 return e; 00096 } 00097 catch (AllBackendsFailedException e) 00098 { 00099 AbstractRequest request = new UnknownRequest("rollback", false, 0, "\n"); 00100 request.setTransactionId(transactionId); 00101 drm.addFailedOnAllBackends(request); 00102 if (drm.getLogger().isDebugEnabled()) 00103 drm 00104 .getLogger() 00105 .debug( 00106 Translate 00107 .get( 00108 "virtualdatabase.distributed.commit.all.backends.locally.failed", 00109 transactionId)); 00110 return e; 00111 } 00112 finally 00113 { 00114 // Notify scheduler for completion 00115 drm.getScheduler().rollbackCompleted(transactionId); 00116 drm.completeTransaction(tid); 00117 } 00118 return Boolean.TRUE; 00119 } 00120 catch (SQLException e) 00121 { 00122 drm.getLogger() 00123 .warn( 00124 Translate 00125 .get("virtualdatabase.distributed.rollback.sqlexception"), e); 00126 throw e; 00127 } 00128 catch (RuntimeException re) 00129 { 00130 drm.getLogger().warn( 00131 Translate.get("virtualdatabase.distributed.rollback.exception"), re); 00132 throw new SQLException(re.getMessage()); 00133 } 00134 }
|