org.enhydra.jdbc.standard
Class StandardXADataSource
java.lang.Object
org.enhydra.jdbc.util.JdbcUtil
org.enhydra.jdbc.core.CoreDataSource
org.enhydra.jdbc.standard.StandardDataSource
org.enhydra.jdbc.standard.StandardConnectionPoolDataSource
org.enhydra.jdbc.standard.StandardXADataSource
- All Implemented Interfaces:
- java.io.Serializable, javax.naming.Referenceable, javax.naming.spi.ObjectFactory, javax.sql.ConnectionPoolDataSource, javax.sql.DataSource, javax.sql.XADataSource
- Direct Known Subclasses:
- IdbXADataSource, InformixXADataSource, OracleXADataSource, SybaseXADataSource
public class StandardXADataSource
- extends StandardConnectionPoolDataSource
- implements javax.sql.XADataSource
Data source for creating StandardXAConnections.
- See Also:
- Serialized Form
Fields inherited from class org.enhydra.jdbc.util.JdbcUtil |
log |
Methods inherited from class org.enhydra.jdbc.core.CoreDataSource |
getDescription, getLoginTimeout, getLogWriter, getPassword, getThreadFactory, getUser, isDebug, isVerbose, setDebug, setDescription, setLoginTimeout, setLogWriter, setThreadFactory, setVerbose, shutdown |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.sql.XADataSource |
getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter |
Methods inherited from interface javax.sql.ConnectionPoolDataSource |
getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter |
Methods inherited from interface javax.sql.DataSource |
getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter |
minCon
public int minCon
maxCon
public int maxCon
deadLockMaxWait
public long deadLockMaxWait
connectionCount
public int connectionCount
deadLockRetryWait
public long deadLockRetryWait
transactionManager
public transient javax.transaction.TransactionManager transactionManager
DEFAULT_MIN_CON
public static final int DEFAULT_MIN_CON
- See Also:
- Constant Field Values
DEFAULT_MAX_CON
public static final int DEFAULT_MAX_CON
- See Also:
- Constant Field Values
DEFAULT_DEADLOCKMAXWAIT
public static final long DEFAULT_DEADLOCKMAXWAIT
- See Also:
- Constant Field Values
DEFAULT_DEADLOCKRETRYWAIT
public static final int DEFAULT_DEADLOCKRETRYWAIT
- See Also:
- Constant Field Values
StandardXADataSource
public StandardXADataSource()
- Constructor
getConnectionCount
public int getConnectionCount()
getXidConnections
public java.util.Hashtable getXidConnections()
getXAConnection
public javax.sql.XAConnection getXAConnection()
throws java.sql.SQLException
- Creates an XA connection using the default username and password.
- Specified by:
getXAConnection
in interface javax.sql.XADataSource
- Throws:
java.sql.SQLException
getXAConnection
public javax.sql.XAConnection getXAConnection(java.lang.String user,
java.lang.String password)
throws java.sql.SQLException
- Creates an XA connection using the supplied username and password.
- Specified by:
getXAConnection
in interface javax.sql.XADataSource
- Throws:
java.sql.SQLException
setTransactionManager
public void setTransactionManager(javax.transaction.TransactionManager tm)
getTransactionManager
public javax.transaction.TransactionManager getTransactionManager()
setUser
public void setUser(java.lang.String user)
- Overrides:
setUser
in class CoreDataSource
setPassword
public void setPassword(java.lang.String password)
- Overrides:
setPassword
in class CoreDataSource
setUrl
public void setUrl(java.lang.String url)
- Description copied from class:
StandardDataSource
- set the database url
- Overrides:
setUrl
in class StandardDataSource
- Parameters:
url
- the string representation of the database url
setDriverName
public void setDriverName(java.lang.String driverName)
throws java.sql.SQLException
- Description copied from class:
StandardDataSource
- set the name of the jdbc driver
- Overrides:
setDriverName
in class StandardDataSource
- Parameters:
driverName
- the string representation of the jdbc driver name
- Throws:
java.sql.SQLException
getXidCount
public int getXidCount()
- Returns the number of connections that are either
prepared or heuristically completed.
freeConnection
public void freeConnection(javax.transaction.xa.Xid id,
boolean placeAtStart)
- Frees a connection to make it eligible for reuse. The free list
is normally a last in, first out list (LIFO). This is efficient.
However, timed out connections are nice to hang onto for error
reporting, so they can be placed at the start. This is less
efficient, but hopefully is a rare occurence.
Here, no need to verify the number of connections, we remove an
object from the xidConnections to put it in th freeConnections
closeFreeConnection
public void closeFreeConnection()
setMinCon
public void setMinCon(int min)
setMaxCon
public void setMaxCon(int max)
setDeadLockMaxWait
public void setDeadLockMaxWait(long deadLock)
getMinCon
public int getMinCon()
getMaxCon
public int getMaxCon()
getDeadLockMaxWait
public long getDeadLockMaxWait()
getAllConnections
public int getAllConnections()
processToWait
public void processToWait()
throws java.lang.Exception
- Throws:
java.lang.Exception
dump
public void dump()
setDeadLockRetryWait
public void setDeadLockRetryWait(long deadLockRetryWait)
getDeadLockRetryWait
public long getDeadLockRetryWait()
toString
public java.lang.String toString()
- Overrides:
toString
in class StandardConnectionPoolDataSource