Top Description Fields Constructors Methods
org.h2.jdbc

public final Class JdbcSavepoint

extends TraceObject
implements Savepoint
Class Inheritance
All Implemented Interfaces
java.sql.Savepoint
Imports
java.sql.SQLException, .Savepoint, org.h2.api.ErrorCode, org.h2.message.DbException, .Trace, .TraceObject, org.h2.util.StringUtils

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

Modifier and TypeField and Description
private JdbcConnection
private final String
private final int
private static final String
Inherited from org.h2.message.TraceObject:
ARRAYBLOBCALLABLE_STATEMENTCLOBCONNECTIONDATA_SOURCEDATABASE_META_DATAPARAMETER_META_DATAPREPARED_STATEMENTRESULT_SETRESULT_SET_META_DATASAVEPOINTSQLXMLSTATEMENTtraceXA_DATA_SOURCEXID

Constructor Summary

AccessConstructor and Description
pack-priv
JdbcSavepoint(JdbcConnection conn, int savepointId, String name, Trace trace, int id)

Method Summary

Modifier and TypeMethod and Description
private void
pack-priv static String

Returns:

the savepoint name
getName
(String
the name (may be null)
name
,
int
the id
id
)

Get the savepoint name for this name or id. If the name is null, the id is used.

public int

Returns:

the id
getSavepointId
()

Implements java.sql.Savepoint.getSavepointId.

Get the generated id of this savepoint.

public String

Returns:

the name
getSavepointName
()

Implements java.sql.Savepoint.getSavepointName.

Get the name of this savepoint.

pack-priv void
release()

Release this savepoint.

pack-priv void
rollback()

Roll back to this savepoint.

public String
toString()

Overrides java.lang.Object.toString.

INTERNAL

Inherited from org.h2.message.TraceObject:
debugCodedebugCodeAssigndebugCodeCalldebugCodeCalldebugCodeCallgetNextIdgetTraceIdgetTraceObjectNameisDebugEnabledisInfoEnabledlogAndConvertquotequoteArrayquoteBigDecimalquoteBytesquoteDatequoteIntArrayquoteMapquoteTimequoteTimestampsetTraceunsupported

Field Detail

connback to summary
private JdbcConnection conn
nameback to summary
private final String name
savepointIdback to summary
private final int savepointId
SYSTEM_SAVEPOINT_PREFIXback to summary
private static final String SYSTEM_SAVEPOINT_PREFIX

Constructor Detail

JdbcSavepointback to summary
pack-priv JdbcSavepoint(JdbcConnection conn, int savepointId, String name, Trace trace, int id)

Method Detail

checkValidback to summary
private void checkValid()
getNameback to summary
pack-priv static String getName(String name, int id)

Get the savepoint name for this name or id. If the name is null, the id is used.

Parameters
name:String

the name (may be null)

id:int

the id

Returns:String

the savepoint name

getSavepointIdback to summary
public int getSavepointId() throws SQLException

Implements java.sql.Savepoint.getSavepointId.

Get the generated id of this savepoint.

Returns:int

the id

Annotations
@Override
Exceptions
SQLException:

Doc from java.sql.Savepoint.getSavepointId.

if this is a named savepoint

getSavepointNameback to summary
public String getSavepointName() throws SQLException

Implements java.sql.Savepoint.getSavepointName.

Get the name of this savepoint.

Returns:String

the name

Annotations
@Override
Exceptions
SQLException:

Doc from java.sql.Savepoint.getSavepointName.

if this is an un-named savepoint

releaseback to summary
pack-priv void release()

Release this savepoint. This method only set the connection to null and does not execute a statement.

rollbackback to summary
pack-priv void rollback()

Roll back to this savepoint.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

INTERNAL

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

Annotations
@Override