Package nl.cwi.monetdb.embedded.env
Class MonetDBEmbeddedSavePoint
java.lang.Object
nl.cwi.monetdb.embedded.env.MonetDBEmbeddedSavePoint
- All Implemented Interfaces:
Savepoint
public class MonetDBEmbeddedSavePoint 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 validaty of save points
is determined by the server, which makes this a light implementation.
- Version:
- 1.0
- Author:
- Pedro Ferreira, Fabian Groffen
-
Constructor Summary
Constructors Constructor Description MonetDBEmbeddedSavePoint()
MonetDBEmbeddedSavePoint(String name)
-
Method Summary
Modifier and Type Method Description int
getSavepointId()
Retrieves the generated ID for the savepoint that this Savepoint object represents.String
getSavepointName()
Retrieves the name of the savepoint that this Savepoint object represents.
-
Constructor Details
-
MonetDBEmbeddedSavePoint
- Throws:
IllegalArgumentException
-
MonetDBEmbeddedSavePoint
public MonetDBEmbeddedSavePoint()
-
-
Method Details
-
getSavepointId
Retrieves the generated ID for the savepoint that this Savepoint object represents.- Specified by:
getSavepointId
in interfaceSavepoint
- Returns:
- the numeric ID of this savepoint
- Throws:
MonetDBEmbeddedException
- if this is a named savepoint
-
getSavepointName
Retrieves the name of the savepoint that this Savepoint object represents.- Specified by:
getSavepointName
in interfaceSavepoint
- Returns:
- the name of this savepoint
- Throws:
MonetDBEmbeddedException
- if this is an un-named savepoint
-