1 24 25 package org.objectweb.cjdbc.controller.virtualdatabase.protocol; 26 27 import java.sql.SQLException ; 28 29 import org.objectweb.cjdbc.common.i18n.Translate; 30 import org.objectweb.cjdbc.common.sql.SelectRequest; 31 import org.objectweb.cjdbc.controller.requestmanager.distributed.DistributedRequestManager; 32 33 39 public class ExecReadRequest extends DistributedRequest 40 { 41 private static final long serialVersionUID = -7183844510032678987L; 42 43 48 public ExecReadRequest(SelectRequest request) 49 { 50 super(request); 51 } 52 53 56 public void scheduleRequest(DistributedRequestManager drm) 57 throws SQLException 58 { 59 } 60 61 64 public Object executeScheduledRequest(DistributedRequestManager drm) 65 throws SQLException 66 { 67 if (!request.isAutoCommit()) 69 { 70 long tid = request.getTransactionId(); 71 try 72 { 73 drm.getTransactionMarker(new Long (tid)); 74 } 75 catch (SQLException e) 76 { request.setIsAutoCommit(true); 86 } 87 } 88 89 try 90 { 91 return drm.execLocalReadRequest((SelectRequest) request); 92 } 93 catch (SQLException e) 94 { 95 drm.getLogger().warn( 96 Translate.get("virtualdatabase.distributed.read.sqlexception", e 97 .getMessage()), e); 98 throw e; 99 } 100 catch (RuntimeException re) 101 { 102 drm.getLogger().warn( 103 Translate.get("virtualdatabase.distributed.read.exception", re 104 .getMessage()), re); 105 throw new SQLException (re.getMessage()); 106 } 107 } 108 109 } | Popular Tags |