Public Member Functions | |
Commit (long transactionId) | |
Object | commit (DistributedRequestManager drm) throws SQLException |
Definition at line 43 of file Commit.java.
|
Creates a new
Definition at line 53 of file Commit.java. 00054 {
00055 this.transactionId = transactionId;
00056 }
|
|
Execution of a distributed commit command on the specified
Definition at line 67 of file Commit.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().commit(tm); 00076 00077 if (drm.getLogger().isDebugEnabled()) 00078 drm.getLogger().debug(Translate.get("transaction.commit", "" + tid)); 00079 00080 try 00081 { 00082 // Send to load balancer 00083 drm.getLoadBalancer().commit(tm); 00084 00085 // Notify the cache 00086 if (drm.getResultCache() != null) 00087 drm.getResultCache().commit(tm.getTransactionId()); 00088 00089 // Notify the recovery log manager 00090 if (drm.getRecoveryLog() != null) 00091 drm.getRecoveryLog().commit(tm); 00092 } 00093 catch (SQLException e) 00094 { 00095 return e; 00096 } 00097 catch (AllBackendsFailedException e) 00098 { 00099 AbstractRequest request = new UnknownRequest("commit", 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().commitCompleted(transactionId); 00116 drm.completeTransaction(tid); 00117 } 00118 return Boolean.TRUE; 00119 } 00120 catch (SQLException e) 00121 { 00122 drm.getLogger().warn( 00123 Translate.get("virtualdatabase.distributed.commit.sqlexception"), e); 00124 throw e; 00125 } 00126 catch (RuntimeException re) 00127 { 00128 drm.getLogger().warn( 00129 Translate.get("virtualdatabase.distributed.commit.exception"), re); 00130 throw new SQLException(re.getMessage()); 00131 } 00132 }
|