org.apache.derby.client.net
Class NetXAConnection

java.lang.Object
  extended by org.apache.derby.client.net.NetXAConnection

public class NetXAConnection
extends java.lang.Object


Field Summary
private  NetConnection netCon
           
 
Constructor Summary
NetXAConnection(NetLogWriter netLogWriter, java.lang.String user, java.lang.String password, ClientBaseDataSource dataSource, int rmId, boolean isXAConn, ClientPooledConnection cpc)
          The construcor for the NetXAConnection.
 
Method Summary
private  void checkPlatformVersion()
           
protected  NetConnection createNetConnection(NetLogWriter netLogWriter, java.lang.String user, java.lang.String password, ClientBaseDataSource dataSource, int rmId, boolean isXAConn, ClientPooledConnection cpc)
          Creates NetConnection for the supported version of jdbc.
protected  void finalize()
           
 byte[] getCorrelatorToken()
           
 NetConnection getNetConnection()
          Returns underlying net connection
 int getPort(javax.transaction.xa.Xid xid)
           
 byte[] getUOWID(javax.transaction.xa.Xid xid)
           
 void readCommit()
           
 void readLocalXACommit_()
           
 void readLocalXARollback_()
           
 void readLocalXAStart_()
           
 void readRollback()
           
 void setCorrelatorToken(byte[] crttoken)
           
(package private)  void setNetXAResource(NetXAResource xares)
           
 void writeCommit()
           
 void writeLocalXACommit_()
           
 void writeLocalXARollback_()
           
 void writeLocalXAStart_()
           
 void writeRollback()
           
 void writeTransactionStart(Statement statement)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

netCon

private NetConnection netCon
Constructor Detail

NetXAConnection

public NetXAConnection(NetLogWriter netLogWriter,
                       java.lang.String user,
                       java.lang.String password,
                       ClientBaseDataSource dataSource,
                       int rmId,
                       boolean isXAConn,
                       ClientPooledConnection cpc)
                throws SqlException
The construcor for the NetXAConnection. The parameter is set to this from ClientXAConnection when it creates an instance of NetXAConnection. This is then passed on the underlying NetConnection constructor and is used to raise StatementEvents from any PreparedStatement that would be created from that NetConnection.

Parameters:
netLogWriter - NetLogWriter object associated with this connection
user - user id for this connection
password - password for this connection
dataSource - The DataSource object passed from the ClientXAConnection object from which this constructor was called
rmId - The Resource manager ID for XA Connections
isXAConn - true if this is a XA connection
cpc - The ClientPooledConnection object from which this NetConnection constructor was called. This is used to pass StatementEvents back to the pooledConnection object
Throws:
SqlException
Method Detail

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

setCorrelatorToken

public void setCorrelatorToken(byte[] crttoken)

getCorrelatorToken

public byte[] getCorrelatorToken()

setNetXAResource

void setNetXAResource(NetXAResource xares)

writeLocalXAStart_

public void writeLocalXAStart_()
                        throws SqlException
Throws:
SqlException

readLocalXAStart_

public void readLocalXAStart_()
                       throws SqlException
Throws:
SqlException

writeLocalXACommit_

public void writeLocalXACommit_()
                         throws SqlException
Throws:
SqlException

readLocalXACommit_

public void readLocalXACommit_()
                        throws SqlException
Throws:
SqlException

writeLocalXARollback_

public void writeLocalXARollback_()
                           throws SqlException
Throws:
SqlException

readLocalXARollback_

public void readLocalXARollback_()
                          throws SqlException
Throws:
SqlException

writeTransactionStart

public void writeTransactionStart(Statement statement)
                           throws SqlException
Throws:
SqlException

getUOWID

public byte[] getUOWID(javax.transaction.xa.Xid xid)

getPort

public int getPort(javax.transaction.xa.Xid xid)

writeCommit

public void writeCommit()
                 throws SqlException
Throws:
SqlException

readCommit

public void readCommit()
                throws SqlException
Throws:
SqlException

writeRollback

public void writeRollback()
                   throws SqlException
Throws:
SqlException

readRollback

public void readRollback()
                  throws SqlException
Throws:
SqlException

getNetConnection

public NetConnection getNetConnection()
Returns underlying net connection

Returns:
NetConnection

checkPlatformVersion

private void checkPlatformVersion()
                           throws SqlException
Throws:
SqlException

createNetConnection

protected NetConnection createNetConnection(NetLogWriter netLogWriter,
                                            java.lang.String user,
                                            java.lang.String password,
                                            ClientBaseDataSource dataSource,
                                            int rmId,
                                            boolean isXAConn,
                                            ClientPooledConnection cpc)
                                     throws SqlException
Creates NetConnection for the supported version of jdbc. This method can be overwritten to return NetConnection of the supported jdbc version.

Parameters:
netLogWriter - NetLogWriter object associated with this connection
user - user id for this connection
password - password for this connection
dataSource - The DataSource object passed from the ClientXAConnection object from which this constructor was called
rmId - The Resource manager ID for XA Connections
isXAConn - true if this is a XA connection
cpc - The ClientPooledConnection object from which this NetConnection constructor was called. This is used to pass StatementEvents back to the pooledConnection object
Returns:
NetConnection
Throws:
SqlException

Built on Thu 2010-12-23 20:49:13+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.