/** * creates and returns NetXAConnection. * Overwrite this method to create different version of NetXAConnection * @param ds * @param logWriter * @param user * @param password * @param rmId * @return NetXAConnection */ protected NetXAConnection getNetXAConnection (ClientBaseDataSource ds, NetLogWriter logWriter, String user, String password, int rmId) throws SqlException { return new NetXAConnection(logWriter, user, password, ds, rmId, true, this); } }
boolean isXAConn, ClientPooledConnection cpc) throws SqlException { netCon = createNetConnection (netLogWriter, user, password, dataSource, rmId, isXAConn,cpc); checkPlatformVersion();
public void saveConnectionVariables() { in_ = actualConn_.getNetConnection().getInputStream(); out_ = actualConn_.getNetConnection().getOutputStream(); crrtkn_ = actualConn_.getCorrelatorToken(); }
public NetXAResource(XAConnection xaconn, int rmId, String userId, String password, com.pivotal.gemfirexd.internal.client.net.NetXAConnection conn) { xaconn_ = xaconn; rmId_ = rmId; conn_ = conn.getNetConnection(); netXAConn_ = conn; rmIdx_ = userId; rmIdy_ = password; port_ = conn_.netAgent_.getPort(); ipaddr_ = conn_.netAgent_.socket_.getLocalAddress().getHostAddress(); conn.setNetXAResource(this); // link the primary connection to the first XACallInfo element conn_.currXACallInfoOffset_ = 0; // construct the NetXACallInfo object for the array. for (int i = 0; i < INITIAL_CALLINFO_ELEMENTS; ++i) { callInfoArray_[i] = new NetXACallInfo(null, XAResource.TMNOFLAGS, this, null); } // initialize the first XACallInfo element with the information from the // primary connection callInfoArray_[0].actualConn_ = conn; callInfoArray_[0].currConnection_ = true; callInfoArray_[0].freeEntry_ = false; // ~~~ save conn_ connection variables in callInfoArray_[0] callInfoArray_[0].saveConnectionVariables(); // add this new XAResource to the list of other XAResources for the Same RM initForReuse(); }
public NetXAConnection createControlConnection(NetLogWriter logWriter, String user, String password, com.pivotal.gemfirexd.internal.jdbc.ClientDataSource dataSource, int rmId, boolean isXAConn) throws SQLException { try { controlCon_ = new NetXAConnection(logWriter, user, password, dataSource, rmId, isXAConn, this); controlCon_.getNetConnection().setTransactionIsolation( Connection.TRANSACTION_READ_UNCOMMITTED); if (logWriter_ != null) { logWriter_.traceExit(this, "createControlConnection", controlCon_); } return controlCon_; } catch ( SqlException se ) { throw se.getSQLException(controlCon_ != null ? controlCon_ .getNetConnection().agent_ : null /* GemStoneAddition */); } }
/** * Invokes readCommit on NetXAConnection */ protected void readXACommit_() throws SqlException { xares_.netXAConn_.readCommit(); }
/** * Invokes writeRollback on NetXAConnection */ protected void readXARollback_() throws SqlException { xares_.netXAConn_.readRollback(); }
public void readRollback() throws SqlException { NetXACallInfo callInfo = netCon.xares_.callInfoArray_ [netCon.currXACallInfoOffset_]; callInfo.xaRetVal_ = XAResource.XA_OK; // initialize XARETVAL readLocalXARollback_(); if (callInfo.xaRetVal_ != XAResource.XA_OK) { // xaRetVal has possible error, format it callInfo.xaFunction_ = NetXAResource.XAFUNC_ROLLBACK; netCon.xares_.xaRetValErrorAccumSQL(callInfo, 0); callInfo.xaRetVal_ = XAResource.XA_OK; // re-initialize XARETVAL throw netCon.xares_.exceptionsOnXA; } // for all XA connectiions // TODO:KATHEY - Do we need this? netCon.setXAState(netCon.XA_T0_NOT_ASSOCIATED); }
public void readCommit() throws SqlException { int xaState = netCon.getXAState(); NetXACallInfo callInfo = netCon.xares_.callInfoArray_ [netCon.currXACallInfoOffset_]; callInfo.xaRetVal_ = XAResource.XA_OK; // initialize XARETVAL if (xaState == netCon.XA_T0_NOT_ASSOCIATED) { readLocalXACommit_(); //TODO: Remove //setXAState(XA_LOCAL); } if (callInfo.xaRetVal_ != XAResource.XA_OK) { // xaRetVal has possible error, format it callInfo.xaFunction_ = NetXAResource.XAFUNC_COMMIT; netCon.xares_.xaRetValErrorAccumSQL(callInfo, 0); callInfo.xaRetVal_ = XAResource.XA_OK; // re-initialize XARETVAL throw netCon.xares_.exceptionsOnXA; } }
throw se.getSQLException(null /* GemStoneAddition */); physicalConnection_ = netXAPhysicalConnection_.getNetConnection();
public NetXAResource(XAConnection xaconn, int rmId, String userId, String password, com.pivotal.gemfirexd.internal.client.net.NetXAConnection conn) { xaconn_ = xaconn; rmId_ = rmId; conn_ = conn.getNetConnection(); netXAConn_ = conn; rmIdx_ = userId; rmIdy_ = password; port_ = conn_.netAgent_.getPort(); ipaddr_ = conn_.netAgent_.socket_.getLocalAddress().getHostAddress(); conn.setNetXAResource(this); // link the primary connection to the first XACallInfo element conn_.currXACallInfoOffset_ = 0; // construct the NetXACallInfo object for the array. for (int i = 0; i < INITIAL_CALLINFO_ELEMENTS; ++i) { callInfoArray_[i] = new NetXACallInfo(null, XAResource.TMNOFLAGS, this, null); } // initialize the first XACallInfo element with the information from the // primary connection callInfoArray_[0].actualConn_ = conn; callInfoArray_[0].currConnection_ = true; callInfoArray_[0].freeEntry_ = false; // ~~~ save conn_ connection variables in callInfoArray_[0] callInfoArray_[0].saveConnectionVariables(); // add this new XAResource to the list of other XAResources for the Same RM initForReuse(); }
public NetXAConnection createControlConnection(NetLogWriter logWriter, String user, String password, com.pivotal.gemfirexd.internal.jdbc.ClientDataSource dataSource, int rmId, boolean isXAConn) throws SQLException { try { controlCon_ = new NetXAConnection(logWriter, user, password, dataSource, rmId, isXAConn, this); controlCon_.getNetConnection().setTransactionIsolation( Connection.TRANSACTION_READ_UNCOMMITTED); if (logWriter_ != null) { logWriter_.traceExit(this, "createControlConnection", controlCon_); } return controlCon_; } catch ( SqlException se ) { throw se.getSQLException(controlCon_ != null ? controlCon_ .getNetConnection().agent_ : null /* GemStoneAddition */); } }
/** * Invokes readCommit on NetXAConnection */ protected void readXACommit_() throws SqlException { xares_.netXAConn_.readCommit(); }
/** * Invokes writeRollback on NetXAConnection */ protected void readXARollback_() throws SqlException { xares_.netXAConn_.readRollback(); }
public void readRollback() throws SqlException { NetXACallInfo callInfo = netCon.xares_.callInfoArray_ [netCon.currXACallInfoOffset_]; callInfo.xaRetVal_ = XAResource.XA_OK; // initialize XARETVAL readLocalXARollback_(); if (callInfo.xaRetVal_ != XAResource.XA_OK) { // xaRetVal has possible error, format it callInfo.xaFunction_ = NetXAResource.XAFUNC_ROLLBACK; netCon.xares_.xaRetValErrorAccumSQL(callInfo, 0); callInfo.xaRetVal_ = XAResource.XA_OK; // re-initialize XARETVAL throw netCon.xares_.exceptionsOnXA; } // for all XA connectiions // TODO:KATHEY - Do we need this? netCon.setXAState(netCon.XA_T0_NOT_ASSOCIATED); }
public void readCommit() throws SqlException { int xaState = netCon.getXAState(); NetXACallInfo callInfo = netCon.xares_.callInfoArray_ [netCon.currXACallInfoOffset_]; callInfo.xaRetVal_ = XAResource.XA_OK; // initialize XARETVAL if (xaState == netCon.XA_T0_NOT_ASSOCIATED) { readLocalXACommit_(); //TODO: Remove //setXAState(XA_LOCAL); } if (callInfo.xaRetVal_ != XAResource.XA_OK) { // xaRetVal has possible error, format it callInfo.xaFunction_ = NetXAResource.XAFUNC_COMMIT; netCon.xares_.xaRetValErrorAccumSQL(callInfo, 0); callInfo.xaRetVal_ = XAResource.XA_OK; // re-initialize XARETVAL throw netCon.xares_.exceptionsOnXA; } }
throw se.getSQLException(null /* GemStoneAddition */); physicalConnection_ = netXAPhysicalConnection_.getNetConnection();
public void saveConnectionVariables() { in_ = actualConn_.getNetConnection().getInputStream(); out_ = actualConn_.getNetConnection().getOutputStream(); crrtkn_ = actualConn_.getCorrelatorToken(); }
boolean isXAConn, ClientPooledConnection cpc) throws SqlException { netCon = createNetConnection (netLogWriter, user, password, dataSource, rmId, isXAConn,cpc); checkPlatformVersion();
/** * creates and returns NetXAConnection. * Overwrite this method to create different version of NetXAConnection * @param ds * @param logWriter * @param user * @param password * @param rmId * @return NetXAConnection */ protected NetXAConnection getNetXAConnection (ClientBaseDataSource ds, NetLogWriter logWriter, String user, String password, int rmId) throws SqlException { return new NetXAConnection(logWriter, user, password, ds, rmId, true, this); } }