public final class FBTpbMapper
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TRANSACTION_NONE
Indicates that transactions are not supported.
|
static java.lang.String |
TRANSACTION_READ_COMMITTED
Dirty reads are prevented; non-repeatable reads and phantom reads can
occur.
|
static java.lang.String |
TRANSACTION_READ_UNCOMMITTED
Dirty reads, non-repeatable reads and phantom reads can occur.
|
static java.lang.String |
TRANSACTION_REPEATABLE_READ
Dirty reads and non-repeatable reads are prevented; phantom reads can
occur.
|
static java.lang.String |
TRANSACTION_SERIALIZABLE
Dirty reads, non-repeatable reads and phantom reads are prevented.
|
| Constructor and Description |
|---|
FBTpbMapper()
Create instance of this class with the default mapping of JDBC
transaction isolation levels to Firebird TPB.
|
FBTpbMapper(java.util.Map<java.lang.String,java.lang.String> stringMapping)
Create instance of this class for the specified string mapping.
|
FBTpbMapper(java.lang.String mappingResource,
java.lang.ClassLoader cl)
Create instance of this class and load mapping from the specified resource.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone() |
boolean |
equals(java.lang.Object obj) |
static FBTpbMapper |
getDefaultMapper() |
TransactionParameterBuffer |
getDefaultMapping()
Get default mapping.
|
TransactionParameterBuffer |
getMapping(int transactionIsolation)
Get mapping for the specified transaction isolation level.
|
static int |
getTransactionIsolationLevel(java.lang.String isolationName)
Convert transaction isolation level name into a corresponding constant.
|
static java.lang.String |
getTransactionIsolationName(int isolationLevel)
Convert transaction isolation level into string.
|
int |
hashCode() |
static void |
processMapping(FirebirdConnectionProperties connectionProperties,
java.util.Map<java.lang.String,java.lang.String> info)
This method extracts TPB mapping information from the connection parameters and adds it to the
connectionProperties.
|
static void |
processMapping(FirebirdConnectionProperties connectionProperties,
java.util.Properties info)
This method extracts TPB mapping information from the connection parameters and adds it to the
connectionProperties.
|
static TransactionParameterBuffer |
processMapping(java.lang.String mapping)
Process comma-separated list of keywords and convert them into TPB
values.
|
void |
setMapping(int transactionIsolation,
TransactionParameterBuffer tpb)
Set mapping for the specified transaction isolation.
|
public static final java.lang.String TRANSACTION_SERIALIZABLE
public static final java.lang.String TRANSACTION_REPEATABLE_READ
public static final java.lang.String TRANSACTION_READ_COMMITTED
public static final java.lang.String TRANSACTION_READ_UNCOMMITTED
public static final java.lang.String TRANSACTION_NONE
public FBTpbMapper()
public FBTpbMapper(java.util.Map<java.lang.String,java.lang.String> stringMapping)
throws java.sql.SQLException
stringMapping - mapping of JDBC transaction isolation to Firebird
mapping. Keys and values of this map must be strings. Keys can have
the following values:
"TRANSACTION_SERIALIZABLE"
"TRANSACTION_REPEATABLE_READ"
"TRANSACTION_READ_COMMITTED"
"TRANSACTION_READ_UNCOMMITTED"
"isc_tpb_consistency"
"isc_tpb_concurrency"
"isc_tpb_read_committed"
"isc_tpb_rec_version"
"isc_tpb_no_rec_version"
"isc_tpb_wait"
"isc_tpb_nowait"
"isc_tpb_read"
"isc_tpb_write"
"isc_tpb_lock_read"
"isc_tpb_lock_write"
"isc_tpb_shared"
"isc_tpb_protected"
java.sql.SQLException - if mapping contains incorrect values.public FBTpbMapper(java.lang.String mappingResource,
java.lang.ClassLoader cl)
throws java.sql.SQLException
mappingResource - name of the resource to load.cl - class loader that should be used to load specified resource.java.sql.SQLException - if resource cannot be loaded or contains incorrect values.public static FBTpbMapper getDefaultMapper()
public static java.lang.String getTransactionIsolationName(int isolationLevel)
isolationLevel - transaction isolation level as integer constant.public static int getTransactionIsolationLevel(java.lang.String isolationName)
isolationName - name of the transaction isolation.public static void processMapping(FirebirdConnectionProperties connectionProperties, java.util.Properties info) throws java.sql.SQLException
info contains separate mappings for each of following transaction isolation levels:
"TRANSACTION_SERIALIZABLE", "TRANSACTION_REPEATABLE_READ" and
"TRANSACTION_READ_COMMITTED".
connectionProperties - FirebirdConnectionProperties to set transaction stateinfo - connection parameters passed into a driver.java.sql.SQLException - if specified mapping is incorrect.processMapping(FirebirdConnectionProperties, Map)public static void processMapping(FirebirdConnectionProperties connectionProperties, java.util.Map<java.lang.String,java.lang.String> info) throws java.sql.SQLException
info contains separate mappings for each of following transaction isolation levels:
"TRANSACTION_SERIALIZABLE", "TRANSACTION_REPEATABLE_READ" and
"TRANSACTION_READ_COMMITTED".
connectionProperties - FirebirdConnectionProperties to set transaction stateinfo - connection parameters passed into a driver.java.sql.SQLException - if specified mapping is incorrect.processMapping(FirebirdConnectionProperties, Properties)public static TransactionParameterBuffer processMapping(java.lang.String mapping) throws java.sql.SQLException
mapping - comma-separated list of keywords.java.sql.SQLException - if mapping contains keyword that is not a TPB parameter.public TransactionParameterBuffer getMapping(int transactionIsolation)
transactionIsolation - transaction isolation level.java.lang.IllegalArgumentException - if specified transaction isolation level is unknown.public void setMapping(int transactionIsolation,
TransactionParameterBuffer tpb)
transactionIsolation - transaction isolation level.tpb - TPB parameters.java.lang.IllegalArgumentException - if incorrect isolation level is specified.public TransactionParameterBuffer getDefaultMapping()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.Object clone()
clone in class java.lang.ObjectCopyright © 2001-2023 Jaybird (Firebird JDBC) team. All rights reserved.