SingleCommitTransaction<T> class abstract

A helper class to easily create single commit transaction.

Single commit transactions are transaction that can only be commit once and become invalid after. This class helps in that it handels this case and automatically throws a AlreadyComittedError if someone tries to commit it twice.

Instead of commitUpdate and commitDelete, you have to implement commitUpdateImpl and commitDeleteImpl. They follow the same semantics as their originals, beeing called by them after it was verified the transaction was not committed yet.

Implemented types

Constructors

SingleCommitTransaction()

Properties

eTag String
The current eTag of the entry.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
key String
The key of the entry beeing modified in the transaction
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value → T?
The current value of the entry.
no setterinherited

Methods

commitDelete() Future<void>
Tries to commit the deletion of the entry.
override
commitDeleteImpl() Future<void>
See commitDelete
commitUpdate(T data) Future<T?>
Tries to commit an update of the entry to data.
override
commitUpdateImpl(T data) Future<T?>
See commitUpdate
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited