Class XaConnectionManager
java.lang.Object
org.tentackle.dbms.DefaultConnectionManager
org.tentackle.jta.XaConnectionManager
- All Implemented Interfaces:
ConnectionManager
A connection manager for XA connections.
Works like the DefaultConnectionManager, i.e. each session gets its own connection,
but the connections are XaManagedConnections that can be enlisted in global transactions.
The physical XA connections are created via BackendInfo.connectXA().
Outside a global transaction, the connections work like any other connection, including local transactions.
For application servers with many sessions, see XaMpxConnectionManager.
- Author:
- harald
- See Also:
-
Field Summary
Fields inherited from class DefaultConnectionManager
conList, dbSize, freeConCount, freeConList, freeDbCount, freeDbList, idOffset, iniSize, maxConSize, maxDbSize, maxMinutes, minMinutes, name, random -
Constructor Summary
ConstructorsConstructorDescriptionCreates a connection manager with the defaults ofDefaultConnectionManager().XaConnectionManager(String name, int iniSize, int maxSize, int idOffset, int minMinutes, int maxMinutes) Creates a new XA connection manager. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcloseUnmanagedConnection(Connection connection) protected Connectionconnect(org.tentackle.sql.BackendInfo backendInfo) protected ManagedConnectioncreateManagedConnection(org.tentackle.sql.Backend backend, org.tentackle.sql.BackendVersionInfo versionInfo, Connection connection) Methods inherited from class DefaultConnectionManager
addConnection, addConnection, assertSessionBelongsToMe, attach, cleanup, cleanupReleasedConnection, closeConnections, createConnection, detach, forceDetach, getAttachTimeout, getConnections, getIndexFromSession, getIndexFromSessionId, getMaxConnections, getMaxCountForClearWarnings, getMaxSessions, getName, getNumConnections, getNumSessions, getSessionIdOffset, getSessionIndex, logConfiguration, login, logout, releaseConnection, removeConnection, removeSessionIndex, setAttachTimeout, setMaxCountForClearWarnings, shutdown, toString, verifyIdleConnection
-
Constructor Details
-
XaConnectionManager
public XaConnectionManager(String name, int iniSize, int maxSize, int idOffset, int minMinutes, int maxMinutes) Creates a new XA connection manager.- Parameters:
name- the name of the connection manageriniSize- the initial size of the session tablemaxSize- the maximum number of connections, 0 = unlimited (dangerous!)idOffset- the offset for session IDs (> 0)minMinutes- minimum minutes a connection should be used, 0 to keep the connection forevermaxMinutes- maximum minutes a connection should be used
-
XaConnectionManager
public XaConnectionManager()Creates a connection manager with the defaults ofDefaultConnectionManager().
-
-
Method Details
-
connect
- Overrides:
connectin classDefaultConnectionManager- Throws:
SQLException
-
createManagedConnection
protected ManagedConnection createManagedConnection(org.tentackle.sql.Backend backend, org.tentackle.sql.BackendVersionInfo versionInfo, Connection connection) - Overrides:
createManagedConnectionin classDefaultConnectionManager
-
closeUnmanagedConnection
- Overrides:
closeUnmanagedConnectionin classDefaultConnectionManager
-