Class FBStandAloneConnectionManager
- java.lang.Object
-
- org.firebirdsql.jaybird.xca.FBStandAloneConnectionManager
-
- All Implemented Interfaces:
java.io.Serializable,XcaConnectionEventListener,XcaConnectionManager
public final class FBStandAloneConnectionManager extends java.lang.Object implements XcaConnectionManager, XcaConnectionEventListener, java.io.Serializable
The classFBStandAloneConnectionManagerprovides the default implementation of FirebirdConnectionManager for standalone use. There is no pooling or other features.- Author:
- David Jencks, Mark Rotteveel
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FirebirdConnectionallocateConnection(FBManagedConnectionFactory mcf, FBConnectionRequestInfo cxRequestInfo)Allocates a newFirebirdConnectionbacked by aFBManagedConnectionfrom the specified factory.voidconnectionClosed(XcaConnectionEvent ce)Notifies the close of a connection.voidconnectionErrorOccurred(XcaConnectionEvent ce)Notifies a connection related error.
-
-
-
Method Detail
-
allocateConnection
public FirebirdConnection allocateConnection(FBManagedConnectionFactory mcf, FBConnectionRequestInfo cxRequestInfo) throws java.sql.SQLException
Description copied from interface:XcaConnectionManagerAllocates a newFirebirdConnectionbacked by aFBManagedConnectionfrom the specified factory.The returned connection should behave as a new connection, but may be backed by an already established (eg pooled) managed connection.
- Specified by:
allocateConnectionin interfaceXcaConnectionManager- Parameters:
mcf- Managed connection factorycxRequestInfo- Specific connection request info- Returns:
- A new
FirebirdConnectioninstance - Throws:
java.sql.SQLException- for generic exceptions
-
connectionClosed
public void connectionClosed(XcaConnectionEvent ce)
Description copied from interface:XcaConnectionEventListenerNotifies the close of a connection.A managed connection notifies its listeners by calling this method when an application component closes a connection handle. The owner of the managed connection can use this event to put the managed connection instance back in to the connection pool, or close the physical connection.
- Specified by:
connectionClosedin interfaceXcaConnectionEventListener- Parameters:
ce- Connection event
-
connectionErrorOccurred
public void connectionErrorOccurred(XcaConnectionEvent ce)
Description copied from interface:XcaConnectionEventListenerNotifies a connection related error.The managed connection instance calls this method to notify its listeners of the occurrence of a physical connection-related error. The event notification happens just before it throws an exception to the application component using the connection handle.
This method indicates that the associated managed connection instance is now invalid and unusable. The owner of the managed connection handles the connection error event notification by initiating owner-specific cleanup (for example, removing the managed connection instance from the connection pool) and then calling the destroy method to destroy the physical connection.
- Specified by:
connectionErrorOccurredin interfaceXcaConnectionEventListener- Parameters:
ce- Connection event
-
-