try { actualBytesRead = netAgent_.getInputStream().read(buffer_, count_, buffer_.length - count_); } catch (java.io.IOException ioe) { netAgent_.throwCommunicationsFailure(ioe); } finally { if (agent_.loggingEnabled()) { netAgent_.accumulateChainBreakingReadExceptionAndThrow( new DisconnectException(netAgent_, new ClientMessageId(SQLState.NET_INSUFFICIENT_DATA),
public void flush_() throws DisconnectException { checkOpen(); sendRequest(); reply_.initialize(); }
public void checkForChainBreakingException_() throws SqlException { int svrcod = getSvrcod(); clearSvrcod(); if (svrcod > CodePoint.SVRCOD_WARNING) // Not for SQL warning, if svrcod > WARNING, then its a chain breaker { super.checkForExceptions(); // throws the accumulated exceptions, we'll always have at least one. } }
final void throwDisconnectException(Throwable cause) throws DisconnectException { final NetAgent netAgent = this.netAgent_; if (netAgent == null) { throw new DisconnectException(null, new ClientMessageId( SQLState.COMMUNICATION_ERROR), cause.getMessage(), cause); } else { try { netAgent.close_(); } catch (Throwable t) { // deliberately ignored } netAgent.throwCommunicationsFailure(cause); } }
netAgent.beginWriteChainOutsideUOW(); netAgent.netConnectionRequest_.writeXaCommit(conn_, xid); netAgent.flowOutsideUOW(); netAgent.netConnectionReply_.readXaCommit(conn_); if (callInfo.xaRetVal_ != XAResource.XA_OK) { // xaRetVal has possible error, format it netAgent.endReadChain(); } catch (SqlException sqle) { rc = XAException.XAER_RMERR;
public boolean reconnectAgent(LogWriter logWriter, int loginTimeout, String server, int port) throws SqlException { resetAgent(logWriter); loginTimeout = getLoginTimeout(loginTimeout); if (this.port_ != port || !this.server_.equals(server) || this.socket_ == null || this.socket_.isClosed()) { close_(); } catch (SqlException ex) { this.port_ = port; initialize(); return true;
if (this.netAgent_ == null) { final SqlException openEx; agent = new NetAgent(this, logWriter, loginTimeout, serverName, port[0], clientSSLMode); if ((openEx = agent.exceptionOpeningSocket_) != null) { try { agent.close_(); } catch (Throwable t) { final String failedServer = this.netAgent_.getServerLocation(); if (this.netAgent_.reconnectAgent(logWriter, this.loginTimeout_, serverName, port[0])) {
padScalarStreamForError(leftToRead, bytesToRead); netAgent_.accumulateReadException(new SqlException(netAgent_.logWriter_, new ClientMessageId(SQLState.NET_IOEXCEPTION_ON_READ), new Integer(parameterIndex), e.getMessage(), e)); netAgent_.accumulateChainBreakingReadExceptionAndThrow( new DisconnectException(netAgent_, new ClientMessageId(SQLState.NET_PREMATURE_EOS_DISCONNECT), if (in.read() != -1) { netAgent_.accumulateReadException(new SqlException( netAgent_.logWriter_, new ClientMessageId(SQLState.NET_INPUTSTREAM_LENGTH_TOO_SMALL), netAgent_.accumulateReadException(new SqlException( netAgent_.logWriter_, new ClientMessageId( sendBytes(netAgent_.getOutputStream()); } catch (java.io.IOException ioe) { netAgent_.throwCommunicationsFailure(ioe); sendBytes(netAgent_.getOutputStream()); } catch (java.io.IOException ioe) { netAgent_.throwCommunicationsFailure(ioe);
checkRequiredObjects(svrcodReceived, rdbnamReceived); netAgent_.setSvrcod(svrcod); netAgent_.accumulateReadException(new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.NET_CONNECT_AUTH_FAILED), msgutil_.getTextMessage(MessageId.CONN_USER_NOT_AUTHORIZED_TO_DB)));
public void throwCommunicationsFailure(Throwable cause) throws com.pivotal.gemfirexd.internal.client.am.DisconnectException { //com.pivotal.gemfirexd.internal.client.am.DisconnectException //accumulateReadExceptionAndDisconnect // note when {6} = 0 it indicates the socket was closed. // need to still validate any token values against message publications. accumulateChainBreakingReadExceptionAndThrow( new com.pivotal.gemfirexd.internal.client.am.DisconnectException(this, new ClientMessageId(SQLState.COMMUNICATION_ERROR), cause.getMessage(), cause)); }
+ " failover for SQLState " + sqle.getSQLState() + " loadBalance=" + this.loadBalance_ + " for connection to " + netAgent.getServerLocation() + (pw != null ? ": " + pw.toString() : "")); netAgent.disconnectEvent();
netAgent.beginWriteChainOutsideUOW(); netAgent.netConnectionRequest_.writeXaStartUnitOfWork(conn_); netAgent.flowOutsideUOW(); netAgent.netConnectionReply_.readXaStartUnitOfWork(conn_); if (callInfo.xaRetVal_ != XAResource.XA_OK) { // xaRetVal has possible error, format it
e); netAgent_.accumulateReadException(sqlex); new Integer(parameterIndex)); netAgent_.accumulateReadException(sqlex); netAgent_.accumulateReadException(new SqlException( netAgent_.logWriter_, new ClientMessageId(
protected final void startSameIdChainParse() throws DisconnectException { readDssHeader(); netAgent_.clearSvrcod(); }
private void readDeferredResetConnection() throws SqlException { if (!netConnection_.resetConnectionAtFirstSql_) { return; } try { netConnection_.readDeferredReset(); checkForExceptions(); } catch (SqlException sqle) { DisconnectException de = new DisconnectException(this, new ClientMessageId(SQLState.CONNECTION_FAILED_ON_DEFERRED_RESET)); de.setNextException(sqle); throw de; } }
netAgent.beginWriteChainOutsideUOW(); netAgent.netConnectionRequest_.writeXaCommit(conn_, xid); netAgent.flowOutsideUOW(); netAgent.netConnectionReply_.readXaCommit(conn_); if (callInfo.xaRetVal_ != XAResource.XA_OK) { // xaRetVal has possible error, format it netAgent.endReadChain(); } catch (SqlException sqle) { rc = XAException.XAER_RMERR;
public boolean reconnectAgent(LogWriter logWriter, int loginTimeout, String server, int port) throws SqlException { resetAgent(logWriter); loginTimeout = getLoginTimeout(loginTimeout); if (this.port_ != port || !this.server_.equals(server) || this.socket_ == null || this.socket_.isClosed()) { close_(); } catch (SqlException ex) { this.port_ = port; initialize(); return true;
if (this.netAgent_ == null) { final SqlException openEx; agent = new NetAgent(this, logWriter, loginTimeout, serverName, port[0], clientSSLMode); if ((openEx = agent.exceptionOpeningSocket_) != null) { try { agent.close_(); } catch (Throwable t) { final String failedServer = this.netAgent_.getServerLocation(); if (this.netAgent_.reconnectAgent(logWriter, this.loginTimeout_, serverName, port[0])) {
padScalarStreamForError(leftToRead, bytesToRead); netAgent_.accumulateReadException(new SqlException(netAgent_.logWriter_, new ClientMessageId(SQLState.NET_IOEXCEPTION_ON_READ), new Integer(parameterIndex), e.getMessage(), e)); netAgent_.accumulateChainBreakingReadExceptionAndThrow( new DisconnectException(netAgent_, new ClientMessageId(SQLState.NET_PREMATURE_EOS_DISCONNECT), if (in.read() != -1) { netAgent_.accumulateReadException(new SqlException( netAgent_.logWriter_, new ClientMessageId(SQLState.NET_INPUTSTREAM_LENGTH_TOO_SMALL), netAgent_.accumulateReadException(new SqlException( netAgent_.logWriter_, new ClientMessageId( sendBytes(netAgent_.getOutputStream()); } catch (java.io.IOException ioe) { netAgent_.throwCommunicationsFailure(ioe); sendBytes(netAgent_.getOutputStream()); } catch (java.io.IOException ioe) { netAgent_.throwCommunicationsFailure(ioe);
checkRequiredObjects(svrcodReceived, rdbnamReceived); netAgent_.setSvrcod(svrcod); netAgent_.accumulateReadException(new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.NET_CONNECT_AUTH_FAILED), msgutil_.getTextMessage(MessageId.CONN_USER_NOT_AUTHORIZED_TO_DB)));