public final class FBManagedConnectionFactory extends java.lang.Object implements FirebirdConnectionProperties, java.io.Serializable
FBManagedConnection, and implements many of the internal
functions of FBManagedConnection. This behavior is required due to firebird requiring all work done in a transaction
to be done over one connection.
To support xa semantics, the correct db handle must be located whenever a managed connection is associated with a xid.
| Constructor and Description |
|---|
FBManagedConnectionFactory()
Create a new pure-Java FBManagedConnectionFactory.
|
FBManagedConnectionFactory(boolean shared)
Create a new pure-Java FBManagedConnectionFactory.
|
FBManagedConnectionFactory(boolean shared,
GDSType gdsType)
Create a new FBManagedConnectionFactory based on the given GDSType.
|
FBManagedConnectionFactory(boolean shared,
GDSType gdsType,
FBConnectionProperties connectionProperties)
Create a new FBManagedConnectionFactory based on the given GDSType and connection properties.
|
FBManagedConnectionFactory(GDSType gdsType)
Create a new FBManagedConnectionFactory based on the given GDSType.
|
FBManagedConnectionFactory(GDSType gdsType,
FBConnectionProperties connectionProperties)
Create a new FBManagedConnectionFactory based on the given GDSType and connection properties.
|
| Modifier and Type | Method and Description |
|---|---|
FBManagedConnectionFactory |
canonicalize()
The
canonicalize method is used in FBDriver to reuse previous fbmcf instances if they have been created. |
java.util.Map<ConnectionProperty,java.lang.Object> |
connectionPropertyValues()
An unmodifiable view on the connection properties held by this BaseProperties implementation.
|
javax.sql.DataSource |
createConnectionFactory()
Creates a
javax.sql.DataSource instance. |
javax.sql.DataSource |
createConnectionFactory(XcaConnectionManager connectionManager)
Creates a
javax.sql.DataSource instance. |
FBManagedConnection |
createManagedConnection()
Creates a new physical connection to the Firebird database using the default configuration.
|
FBManagedConnection |
createManagedConnection(FBConnectionRequestInfo connectionRequestInfo)
Creates a new physical connection to the Firebird database.
|
boolean |
equals(java.lang.Object other) |
void |
forget(FBManagedConnection mc,
javax.transaction.xa.Xid xid) |
java.lang.Boolean |
getBooleanProperty(java.lang.String name)
Retrieves a
boolean property value by name. |
FBConnectionProperties |
getCacheKey() |
FbDatabaseFactory |
getDatabaseFactory() |
FBConnectionRequestInfo |
getDefaultConnectionRequestInfo() |
FBTpb |
getDefaultTpb() |
GDSType |
getGDSType()
Get the GDS implementation type around which this factory is based.
|
java.lang.Integer |
getIntProperty(java.lang.String name)
Retrieves an
int property value by name. |
java.lang.String |
getProperty(java.lang.String name)
Retrieves a string property value by name.
|
boolean |
getShared() |
FBTpb |
getTpb(int isolation) |
TransactionParameterBuffer |
getTransactionParameters(int isolation)
Get the transaction parameter buffer corresponding to the current
connection request information.
|
int |
hashCode() |
void |
recover(FBManagedConnection mc,
javax.transaction.xa.Xid xid) |
void |
setBooleanProperty(java.lang.String name,
java.lang.Boolean value)
Sets a
boolean property by name. |
void |
setDefaultConnectionManager(XcaConnectionManager defaultCm) |
void |
setIntProperty(java.lang.String name,
java.lang.Integer value)
Sets an
int property by name. |
void |
setNonStandardProperty(java.lang.String propertyMapping)
Set the property that does not have corresponding setter method.
|
void |
setProperty(java.lang.String name,
java.lang.String value)
Sets a property by name.
|
void |
setTransactionParameters(int isolation,
TransactionParameterBuffer tpb)
Set transaction parameters for the specified transaction isolation level.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetBuffersNumber, getDatabase, getNonStandardProperty, getUserName, setBuffersNumber, setDatabase, setNonStandardProperty, setUserNamegetBlobBufferSize, getDatabaseName, getDataTypeBind, getDecfloatRound, getDecfloatTraps, getDefaultIsolation, getDefaultTransactionIsolation, getGeneratedKeysEnabled, getPageCacheSize, getScrollableCursor, getServerBatchBufferSize, getSessionTimeZone, getSqlDialect, getTpbMapping, isColumnLabelForName, isDefaultResultSetHoldable, isIgnoreProcedureType, isTimestampUsesLocalTimezone, isUseFirebirdAutocommit, isUseServerBatch, isUseStreamBlobs, setBlobBufferSize, setColumnLabelForName, setDatabaseName, setDataTypeBind, setDecfloatRound, setDecfloatTraps, setDefaultIsolation, setDefaultResultSetHoldable, setDefaultTransactionIsolation, setGeneratedKeysEnabled, setIgnoreProcedureType, setPageCacheSize, setScrollableCursor, setServerBatchBufferSize, setSessionTimeZone, setSqlDialect, setTimestampUsesLocalTimezone, setTpbMapping, setUseFirebirdAutocommit, setUseServerBatch, setUseStreamBlobsgetAuthPlugins, getCharSet, getConnectTimeout, getDbCryptConfig, getEncoding, getParallelWorkers, getPassword, getPortNumber, getProcessId, getProcessName, getRoleName, getServerName, getSocketBufferSize, getSoTimeout, getType, getUser, getWireCrypt, isWireCompression, setAuthPlugins, setCharSet, setConnectTimeout, setDbCryptConfig, setEncoding, setParallelWorkers, setPassword, setPortNumber, setProcessId, setProcessName, setRoleName, setServerName, setSocketBufferSize, setSoTimeout, setType, setUser, setWireCompression, setWireCryptgetBooleanProperty, getIntProperty, getPropertypublic FBManagedConnectionFactory()
This managed connection factory can be shared.
public FBManagedConnectionFactory(boolean shared)
shared - Indicates that this Managed Connection Factory can be shared or not. When true configuration
changes are not allowed after the first connection or datasource has been created to ensure all shared
users have the same expectation of configuration.public FBManagedConnectionFactory(GDSType gdsType)
This managed connection factory can be shared.
gdsType - The GDS implementation to usepublic FBManagedConnectionFactory(boolean shared,
GDSType gdsType)
shared - Indicates that this Managed Connection Factory can be shared or not. When true configuration
changes are not allowed after the first connection or datasource has been created to ensure all shared
users have the same expectation of configuration.gdsType - The GDS implementation to usepublic FBManagedConnectionFactory(GDSType gdsType, FBConnectionProperties connectionProperties)
This managed connection factory can be shared.
gdsType - The GDS implementation to useconnectionProperties - Initial connection properties (will be copied), use of null is allowedpublic FBManagedConnectionFactory(boolean shared,
GDSType gdsType,
FBConnectionProperties connectionProperties)
shared - Indicates that this Managed Connection Factory can be shared or not. When true configuration
changes are not allowed after the first connection or datasource has been created to ensure all shared
users have the same expectation of configuration.gdsType - The GDS implementation to useconnectionProperties - Initial connection properties (will be copied), use of null is allowedpublic FbDatabaseFactory getDatabaseFactory()
public GDSType getGDSType()
public boolean getShared()
true if this instance can be safely shared (modification disallowed after creation of first
connection/data source)public TransactionParameterBuffer getTransactionParameters(int isolation)
FirebirdConnectionPropertiesgetTransactionParameters in interface FirebirdConnectionPropertiesisolation - transaction isolation level for which TPB should be returned.TransactionParameterBuffer.public void setNonStandardProperty(java.lang.String propertyMapping)
FirebirdConnectionPropertiessetNonStandardProperty in interface FirebirdConnectionPropertiespropertyMapping - parameter value in the propertyName[=propertyValue] form, this allows setting non-standard
parameters using configuration files.public void setTransactionParameters(int isolation,
TransactionParameterBuffer tpb)
FirebirdConnectionPropertiessetTransactionParameters in interface FirebirdConnectionPropertiesisolation - transaction isolation level.tpb - instance of TransactionParameterBuffer containing
transaction parameters.public void setDefaultConnectionManager(XcaConnectionManager defaultCm)
public java.lang.String getProperty(java.lang.String name)
BaseProperties
For properties with an explicit default, this method should return the string presentation of that default, not
null. For int or boolean the string equivalent is returned.
getProperty in interface BasePropertiesname - Property name (not null or empty)null when not set or not a known propertypublic void setProperty(java.lang.String name,
java.lang.String value)
BaseProperties
This method can be used to set all defined properties, but also properties not known by Jaybird. When setting
int or boolean properties, the appropriate conversions are applied. Using null will
reset to the default value. For boolean properties, an empty string is taken to mean true.
setProperty in interface BasePropertiesname - Property name (not null or empty)value - Property value (use null to apply default)public java.lang.Integer getIntProperty(java.lang.String name)
BasePropertiesint property value by name.
For properties with an explicit default, this method should return the integer presentation of that default. For
implementation simplicity, it is allowed to convert any string property to int instead of checking if
something is actually an int property
getIntProperty in interface BasePropertiesname - Property name (not null or empty)null when not setpublic void setIntProperty(java.lang.String name,
java.lang.Integer value)
BasePropertiesint property by name.
For implementation simplicity, it is allowed to also set string properties. The value set will be the string equivalent.
setIntProperty in interface BasePropertiesname - Property name (not null or empty)value - Property value (use null to apply default)public java.lang.Boolean getBooleanProperty(java.lang.String name)
BasePropertiesboolean property value by name.
For properties with an explicit default, this method should return the boolean presentation of that default. For
implementation simplicity, it is allowed to convert any string property to boolean instead of checking
if something is actually an int property
getBooleanProperty in interface BasePropertiesname - Property name (not null or empty)null when not setpublic void setBooleanProperty(java.lang.String name,
java.lang.Boolean value)
BasePropertiesboolean property by name.
For implementation simplicity, it is allowed to also set string properties. The value set will be the string equivalent.
setBooleanProperty in interface BasePropertiesname - Property name (not null or empty)value - Property value (use null to apply default)public java.util.Map<ConnectionProperty,java.lang.Object> connectionPropertyValues()
BaseProperties
Be aware, implementations can have additional properties that are not mapped from ConnectionProperty.
Such properties will need to be retrieved in an implementation-specific manner.
connectionPropertyValues in interface BasePropertiespublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic FBConnectionRequestInfo getDefaultConnectionRequestInfo() throws java.sql.SQLException
java.sql.SQLExceptionpublic FBTpb getDefaultTpb() throws java.sql.SQLException
java.sql.SQLExceptionpublic FBTpb getTpb(int isolation) throws java.sql.SQLException
java.sql.SQLExceptionpublic javax.sql.DataSource createConnectionFactory(XcaConnectionManager connectionManager)
javax.sql.DataSource instance. The data source instance gets initialized with the passed
XcaConnectionManager.connectionManager - Connection managerpublic javax.sql.DataSource createConnectionFactory()
javax.sql.DataSource instance. The data source instance gets initialized with a default
XcaConnectionManager provided by the resource adapter.public FBManagedConnection createManagedConnection() throws java.sql.SQLException
java.sql.SQLException - generic exceptioncreateManagedConnection(FBConnectionRequestInfo)public FBManagedConnection createManagedConnection(FBConnectionRequestInfo connectionRequestInfo) throws java.sql.SQLException
ManagedConnectionFactory uses the additional ConnectionRequestInfo to create this new connection.
connectionRequestInfo - Additional resource adapter specific connection request information, can be null for defaultjava.sql.SQLException - generic exceptioncreateManagedConnection()public FBManagedConnectionFactory canonicalize()
canonicalize method is used in FBDriver to reuse previous fbmcf instances if they have been created.
It should really be package access levelFBManagedConnectionFactory valuepublic void forget(FBManagedConnection mc, javax.transaction.xa.Xid xid)
public void recover(FBManagedConnection mc, javax.transaction.xa.Xid xid)
public FBConnectionProperties getCacheKey()
Copyright © 2001-2024 Jaybird (Firebird JDBC) team. All rights reserved.