Module org.firebirdsql.jaybird
Class TransactionNameMapping
java.lang.Object
org.firebirdsql.jaybird.props.internal.TransactionNameMapping
Mapping of transaction names to JDBC transaction code and vice versa.
- Since:
- 5
- Author:
- Mark Rotteveel
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic int
toIsolationLevel
(String isolationLevelName) Maps a transaction isolation level name to the JDBC transaction isolation level.static String
toIsolationLevelName
(int isolationLevel) Maps a JDBC transaction isolation level to a string name.static String
toIsolationLevelName
(int isolationLevel, boolean lenient) Maps a JDBC transaction isolation level to a string name.
-
Field Details
-
TRANSACTION_NONE
- See Also:
-
TRANSACTION_READ_UNCOMMITTED
- See Also:
-
TRANSACTION_READ_COMMITTED
- See Also:
-
TRANSACTION_REPEATABLE_READ
- See Also:
-
TRANSACTION_SERIALIZABLE
- See Also:
-
-
Method Details
-
toIsolationLevel
Maps a transaction isolation level name to the JDBC transaction isolation level.Accepted string names are
"TRANSACTION_NONE"
,"TRANSACTION_READ_UNCOMMITTED"
,"TRANSACTION_READ_COMMITTED"
,"TRANSACTION_REPEATABLE_READ"
,"TRANSACTION_SERIALIZABLE"
. To simplify mapping connection properties, the string value of the isolation level integer (e.g."2"
forConnection.TRANSACTION_READ_COMMITTED
) is also accepted.- Parameters:
isolationLevelName
- Transaction isolation level name or integer string (notnull
)- Returns:
- JDBC standard isolation level value
- Throws:
IllegalArgumentException
- For an unknown transaction isolation level name
-
toIsolationLevelName
Maps a JDBC transaction isolation level to a string name.- Parameters:
isolationLevel
- JDBC isolation level- Returns:
- name of the isolation level (e.g.
"TRANSACTION_READ_COMMITTED"
) - Throws:
IllegalArgumentException
- WhenisolationLevel
is not a known JDBC transaction isolation level
-
toIsolationLevelName
Maps a JDBC transaction isolation level to a string name.- Parameters:
isolationLevel
- JDBC isolation levellenient
-true
return integer string for unknown values,false
throwIllegalArgumentException
for unknown values- Returns:
- name of the isolation level (e.g. TRANSACTION_READ_COMMITTED), or, when
lenient
istrue
, the integer string for unknown values - Throws:
IllegalArgumentException
- WhenisolationLevel
is not a known JDBC transaction isolation level andlenient
isfalse
-