wt.pom
Class WTConnection

java.lang.Object
  extended bywt.pom.WTConnection

public class WTConnection
extends Object

WTConnection provides a datastore connection

See Also:
PersistentObjectManager, TransactionManager

Field Summary
private  int activeStatementCount
           
(package private) static int AVAILABLE
           
private static String CLASSNAME
           
private  Connection datastoreConnection
           
static boolean DEBUG
           
private static String DEFAULT_SELECTOR
           
private  PDSEncoder encoder
           
private  boolean encoderBusy
           
(package private) static int INVALID_OWNER
           
(package private)  long lastTouched
           
private static DebugWriter LOG
           
(package private)  long owner
           
private  PDSIfc pds
           
private  StatementCache statementCache
           
private  SoftReference statementCacheReference
           
private  TransactionManager transactionMgr
           
 
Constructor Summary
WTConnection(PDSIfc pds)
           
 
Method Summary
private  boolean _isTransactionActive()
           
(package private)  void checkOwner()
           
private  void connect()
           
 void disconnect()
          Disconnect from a datastore.
 void freeEncoder(PDSEncoder a_encoder)
           
 void freeStatement(String sql, PreparedStatement pstmt, boolean close)
           
 void freeStatement(String sql, PreparedStatement pstmt, boolean close, boolean clear)
           
(package private)  void freeStatementCache(boolean a_clear)
           
 Connection getConnection()
           
 PDSEncoder getEncoder()
           
(package private)  long getLastTouched()
           
(package private)  long getOwner()
           
 PDSIfc getPds()
           
private  StatementCache getStatementCache()
           
protected  TransactionManager getTransactionManager()
           
 void hold()
           
(package private)  boolean isActive()
           
 boolean isTransactionActive()
           
 CallableStatement prepareCall(String sql)
           
 PreparedStatement prepareStatement(String sql)
           
 PreparedStatement prepareStatement(String sql, int fetchSize)
           
 void reconnect()
           
 void release()
           
(package private)  void setOwner(long owner)
           
(package private)  void touch()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pds

private PDSIfc pds

datastoreConnection

private Connection datastoreConnection

transactionMgr

private TransactionManager transactionMgr

encoder

private PDSEncoder encoder

encoderBusy

private boolean encoderBusy

activeStatementCount

private int activeStatementCount

lastTouched

long lastTouched

statementCache

private StatementCache statementCache

statementCacheReference

private SoftReference statementCacheReference

INVALID_OWNER

static int INVALID_OWNER

AVAILABLE

static int AVAILABLE

CLASSNAME

private static final String CLASSNAME

DEBUG

public static final boolean DEBUG

LOG

private static final DebugWriter LOG

DEFAULT_SELECTOR

private static final String DEFAULT_SELECTOR
See Also:
Constant Field Values

owner

long owner
Constructor Detail

WTConnection

public WTConnection(PDSIfc pds)
             throws ConnectionException
Method Detail

setOwner

void setOwner(long owner)

getOwner

long getOwner()

checkOwner

void checkOwner()

touch

void touch()

getLastTouched

long getLastTouched()

connect

private void connect()
              throws ConnectionException
Throws:
ConnectionException

disconnect

public void disconnect()
                throws ConnectionException
Disconnect from a datastore.

Throws:
ConnectionException - Occurs if the persistent object manager cannont disconnect from the datastore.

getPds

public PDSIfc getPds()

reconnect

public void reconnect()
               throws PersistenceException
Throws:
PersistenceException

getConnection

public Connection getConnection()

getTransactionManager

protected TransactionManager getTransactionManager()

isTransactionActive

public boolean isTransactionActive()

isActive

boolean isActive()

getStatementCache

private StatementCache getStatementCache()

freeStatementCache

void freeStatementCache(boolean a_clear)

hold

public void hold()

release

public void release()

prepareStatement

public PreparedStatement prepareStatement(String sql)
                                   throws SQLException
Throws:
SQLException

prepareStatement

public PreparedStatement prepareStatement(String sql,
                                          int fetchSize)
                                   throws SQLException
Throws:
SQLException

prepareCall

public CallableStatement prepareCall(String sql)
                              throws SQLException
Throws:
SQLException

freeStatement

public void freeStatement(String sql,
                          PreparedStatement pstmt,
                          boolean close)

freeStatement

public void freeStatement(String sql,
                          PreparedStatement pstmt,
                          boolean close,
                          boolean clear)

getEncoder

public PDSEncoder getEncoder()
                      throws IOException
Throws:
IOException

freeEncoder

public void freeEncoder(PDSEncoder a_encoder)

_isTransactionActive

private boolean _isTransactionActive()