org.apache.derby.client
Class ClientXAConnection

java.lang.Object
  extended by org.apache.derby.client.ClientPooledConnection
      extended by org.apache.derby.client.ClientXAConnection
All Implemented Interfaces:
javax.sql.PooledConnection, javax.sql.XAConnection
Direct Known Subclasses:
ClientXAConnection40

public class ClientXAConnection
extends ClientPooledConnection
implements javax.sql.XAConnection


Field Summary
private  NetXAConnection controlCon_
           
private  ClientXADataSource derbyds_
           
private  boolean fFirstGetConnection_
           
private  java.sql.Connection logicalCon_
           
private  NetXAResource netXares_
           
private static int rmIdSeed_
           
private  javax.transaction.xa.XAResource xares_
           
 
Fields inherited from class org.apache.derby.client.ClientPooledConnection
logicalConnection_, logWriter_, netPhysicalConnection_, netXAPhysicalConnection_, physicalConnection_, rmId_
 
Constructor Summary
ClientXAConnection(ClientXADataSource ds, NetLogWriter logWtr, java.lang.String userId, java.lang.String password)
           
 
Method Summary
 void close()
          Closes the physical connection to the data source and frees all assoicated resources.
 NetXAConnection createControlConnection(NetLogWriter logWriter, java.lang.String user, java.lang.String password, ClientDataSource dataSource, int rmId, boolean isXAConn)
           
 java.sql.Connection getConnection()
          Creates a logical connection.
 ClientXADataSource getDataSource()
           
 int getRmId()
           
private static int getUnigueRmId()
           
 javax.transaction.xa.XAResource getXAResource()
           
 
Methods inherited from class org.apache.derby.client.ClientPooledConnection
addConnectionEventListener, finalize, getNetXAConnection, informListeners, isStatementPoolingEnabled, nullLogicalConnection, onStatementClose, onStatementErrorOccurred, recycleConnection, removeConnectionEventListener
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.sql.PooledConnection
addConnectionEventListener, addStatementEventListener, removeConnectionEventListener, removeStatementEventListener
 

Field Detail

rmIdSeed_

private static int rmIdSeed_

derbyds_

private ClientXADataSource derbyds_

xares_

private javax.transaction.xa.XAResource xares_

netXares_

private NetXAResource netXares_

fFirstGetConnection_

private boolean fFirstGetConnection_

logicalCon_

private java.sql.Connection logicalCon_

controlCon_

private NetXAConnection controlCon_
Constructor Detail

ClientXAConnection

public ClientXAConnection(ClientXADataSource ds,
                          NetLogWriter logWtr,
                          java.lang.String userId,
                          java.lang.String password)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException
Method Detail

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Description copied from class: ClientPooledConnection
Creates a logical connection.

This is the standard API for getting a logical connection handle for a pooled connection. No "resettable" properties are passed, so user, password, and all other properties may not change.

Specified by:
getConnection in interface javax.sql.PooledConnection
Overrides:
getConnection in class ClientPooledConnection
Throws:
java.sql.SQLException - if creating a new logical connection fails

getUnigueRmId

private static int getUnigueRmId()

getRmId

public int getRmId()

getXAResource

public javax.transaction.xa.XAResource getXAResource()
                                              throws java.sql.SQLException
Specified by:
getXAResource in interface javax.sql.XAConnection
Throws:
java.sql.SQLException

getDataSource

public ClientXADataSource getDataSource()
                                 throws SqlException
Throws:
SqlException

createControlConnection

public NetXAConnection createControlConnection(NetLogWriter logWriter,
                                               java.lang.String user,
                                               java.lang.String password,
                                               ClientDataSource dataSource,
                                               int rmId,
                                               boolean isXAConn)
                                        throws java.sql.SQLException
Throws:
java.sql.SQLException

close

public void close()
           throws java.sql.SQLException
Description copied from class: ClientPooledConnection
Closes the physical connection to the data source and frees all assoicated resources.

Specified by:
close in interface javax.sql.PooledConnection
Overrides:
close in class ClientPooledConnection
Throws:
java.sql.SQLException - if closing the connection causes an error. Note that this connection can still be considered closed even if an error occurs.

Built on Thu 2012-03-29 21:53:33+0000, from revision ???

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