Package nl.cwi.monetdb.jdbc
Class MonetSavepoint
java.lang.Object
nl.cwi.monetdb.jdbc.MonetSavepoint
- All Implemented Interfaces:
Savepoint
public final class MonetSavepoint extends Object implements Savepoint
The representation of a savepoint, which is a point within the current
transaction that can be referenced from the Connection.rollback method.
When a transaction is rolled back to a savepoint all changes made after
that savepoint are undone.
Savepoints can be either named or unnamed. Unnamed savepoints are
identified by an ID generated by the underlying data source.
This little class is nothing more than a container for a name and/or
an id. Each instance of this class always has an id, which is used for
internal representation of the save point.
Because the IDs which get generated are a logical sequence, application
wide, two concurrent transactions are guaranteed to not to have the same
save point identifiers. In this implementation the validity of save points
is determined by the server, which makes this a light implementation.
- Version:
- 1.0
- Author:
- Fabian Groffen
-
Constructor Summary
Constructors Constructor Description MonetSavepoint()Creates an unnamed MonetSavepoint objectMonetSavepoint(String name)Creates a named MonetSavepoint object -
Method Summary
Modifier and Type Method Description intgetSavepointId()Retrieves the generated ID for the savepoint that this Savepoint object represents.StringgetSavepointName()Retrieves the name of the savepoint that this Savepoint object represents.
-
Constructor Details
-
MonetSavepoint
Creates a named MonetSavepoint object- Throws:
IllegalArgumentException
-
MonetSavepoint
public MonetSavepoint()Creates an unnamed MonetSavepoint object
-
-
Method Details
-
getSavepointId
Retrieves the generated ID for the savepoint that this Savepoint object represents.- Specified by:
getSavepointIdin interfaceSavepoint- Returns:
- the numeric ID of this savepoint
- Throws:
SQLException- if this is a named savepoint
-
getSavepointName
Retrieves the name of the savepoint that this Savepoint object represents.- Specified by:
getSavepointNamein interfaceSavepoint- Returns:
- the name of this savepoint
- Throws:
SQLException- if this is an un-named savepoint
-