src/org/objectweb/cjdbc/controller/virtualdatabase/protocol/Commit.java

説明を見る。
00001 00025 package org.objectweb.cjdbc.controller.virtualdatabase.protocol; 00026 00027 import java.sql.SQLException; 00028 00029 import org.objectweb.cjdbc.common.i18n.Translate; 00030 import org.objectweb.cjdbc.common.sql.AbstractRequest; 00031 import org.objectweb.cjdbc.common.sql.UnknownRequest; 00032 import org.objectweb.cjdbc.controller.loadbalancer.AllBackendsFailedException; 00033 import org.objectweb.cjdbc.controller.requestmanager.TransactionMarkerMetaData; 00034 import org.objectweb.cjdbc.controller.requestmanager.distributed.DistributedRequestManager; 00035 00042 public class Commit extends CJDBCGroupMessage 00043 { 00044 00045 private long transactionId; 00046 00052 public Commit(long transactionId) 00053 { 00054 this.transactionId = transactionId; 00055 } 00056 00060 public Object commit(DistributedRequestManager drm) throws SQLException 00061 { 00062 try 00063 { 00064 Long tid = new Long(transactionId); 00065 TransactionMarkerMetaData tm = drm.getTransactionMarker(tid); 00066 00067 // Wait for the scheduler to give us the authorization to execute 00068 drm.getScheduler().commit(tm); 00069 00070 if (drm.getLogger().isDebugEnabled()) 00071 drm.getLogger().debug(Translate.get("transaction.commit", "" + tid)); 00072 00073 try 00074 { 00075 // Send to load balancer 00076 drm.getLoadBalancer().commit(tm); 00077 00078 // Notify the cache 00079 if (drm.getResultCache() != null) 00080 drm.getResultCache().commit(tm.getTransactionId()); 00081 00082 // Notify the recovery log manager 00083 if (drm.getRecoveryLog() != null) 00084 drm.getRecoveryLog().commit(tm); 00085 } 00086 catch (SQLException e) 00087 { 00088 return e; 00089 } 00090 catch (AllBackendsFailedException e) 00091 { 00092 AbstractRequest request = new UnknownRequest("commit", false, 0, "\n"); 00093 request.setTransactionId(transactionId); 00094 drm.addFailedOnAllBackends(request); 00095 if (drm.getLogger().isDebugEnabled()) 00096 drm.getLogger().debug(Translate.get("virtualdatabase.distributed.commit.all.backends.locally.failed",transactionId)); 00097 return e; 00098 } 00099 finally 00100 { 00101 // Notify scheduler for completion 00102 drm.getScheduler().commitCompleted(transactionId); 00103 drm.completeTransaction(tid); 00104 } 00105 return Boolean.TRUE; 00106 } 00107 catch (SQLException e) 00108 { 00109 drm.getLogger() 00110 .warn(Translate.get("virtualdatabase.distributed.commit.sqlexception"), e); 00111 throw e; 00112 } 00113 catch (RuntimeException re) 00114 { 00115 drm.getLogger().warn(Translate.get("virtualdatabase.distributed.commit.exception"), re); 00116 throw new SQLException(re.getMessage()); 00117 } 00118 } 00119 00120 }

CJDBCversion1.0.4に対してTue Oct 12 15:16:04 2004に生成されました。 doxygen 1.3.8