Package org.h2.jdbc
Class JdbcSavepoint
java.lang.Object
org.h2.message.TraceObject
org.h2.jdbc.JdbcSavepoint
- All Implemented Interfaces:
Savepoint
A savepoint is a point inside a transaction to where a transaction can be
rolled back. The tasks that where done before the savepoint are not rolled
back in this case.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate JdbcConnection
private final String
private final int
private static final String
Fields inherited from class org.h2.message.TraceObject
ARRAY, BLOB, CALLABLE_STATEMENT, CLOB, CONNECTION, DATA_SOURCE, DATABASE_META_DATA, PARAMETER_META_DATA, PREPARED_STATEMENT, RESULT_SET, RESULT_SET_META_DATA, SAVEPOINT, SQLXML, STATEMENT, trace, XA_DATA_SOURCE, XID
-
Constructor Summary
ConstructorsConstructorDescriptionJdbcSavepoint
(JdbcConnection conn, int savepointId, String name, Trace trace, int id) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
(package private) static String
Get the savepoint name for this name or id.int
Get the generated id of this savepoint.Get the name of this savepoint.(package private) void
release()
Release this savepoint.(package private) void
rollback()
Roll back to this savepoint.toString()
INTERNALMethods inherited from class org.h2.message.TraceObject
debugCode, debugCodeAssign, debugCodeCall, debugCodeCall, debugCodeCall, getNextId, getTraceId, getTraceObjectName, isDebugEnabled, isInfoEnabled, logAndConvert, quote, quoteArray, quoteBigDecimal, quoteBytes, quoteDate, quoteIntArray, quoteMap, quoteTime, quoteTimestamp, setTrace, unsupported
-
Field Details
-
SYSTEM_SAVEPOINT_PREFIX
- See Also:
-
savepointId
private final int savepointId -
name
-
conn
-
-
Constructor Details
-
JdbcSavepoint
JdbcSavepoint(JdbcConnection conn, int savepointId, String name, Trace trace, int id)
-
-
Method Details
-
release
void release()Release this savepoint. This method only set the connection to null and does not execute a statement. -
getName
Get the savepoint name for this name or id. If the name is null, the id is used.- Parameters:
name
- the name (may be null)id
- the id- Returns:
- the savepoint name
-
rollback
void rollback()Roll back to this savepoint. -
checkValid
private void checkValid() -
getSavepointId
Get the generated id of this savepoint.- Specified by:
getSavepointId
in interfaceSavepoint
- Returns:
- the id
- Throws:
SQLException
-
getSavepointName
Get the name of this savepoint.- Specified by:
getSavepointName
in interfaceSavepoint
- Returns:
- the name
- Throws:
SQLException
-
toString
INTERNAL
-