1 23 24 package org.continuent.sequoia.controller.virtualdatabase.protocol; 25 26 import java.io.Serializable ; 27 import java.sql.SQLException ; 28 29 import org.continuent.sequoia.common.i18n.Translate; 30 import org.continuent.sequoia.controller.requestmanager.distributed.DistributedRequestManager; 31 import org.continuent.sequoia.controller.requests.SelectRequest; 32 33 42 public class ExecRemoteStatementExecuteQuery extends DistributedRequest 43 { 44 private static final long serialVersionUID = -7183844510032678987L; 45 46 51 public ExecRemoteStatementExecuteQuery(SelectRequest request) 52 { 53 super(request); 54 } 55 56 59 public Object scheduleRequest(DistributedRequestManager drm) 60 throws SQLException 61 { 62 return null; 63 } 64 65 68 public Serializable executeScheduledRequest(DistributedRequestManager drm) 69 throws SQLException 70 { 71 if (!request.isAutoCommit()) 73 { 74 long tid = request.getTransactionId(); 75 try 76 { 77 drm.getTransactionMetaData(new Long (tid)); 78 } 79 catch (SQLException e) 80 { request.setIsAutoCommit(true); 90 } 91 } 92 93 try 94 { 95 return drm.execLocalStatementExecuteQuery((SelectRequest) request); 96 } 97 catch (SQLException e) 98 { 99 drm.getLogger().warn( 100 Translate.get("virtualdatabase.distributed.read.sqlexception", e 101 .getMessage()), e); 102 return e; 103 } 104 catch (RuntimeException re) 105 { 106 drm.getLogger().warn( 107 Translate.get("virtualdatabase.distributed.read.exception", re 108 .getMessage()), re); 109 return new SQLException (re.getMessage()); 110 } 111 } 112 113 116 public String toString() 117 { 118 return "S " + request.getId() + " " + request.getTransactionId() + " " 119 + request.getUniqueKey(); 120 } 121 122 } | Popular Tags |