NSTransaction class
A database transaction. Call commit or rollback to finish it.
Uncommitted changes are visible within this transaction via get, put, delete, and query, but not to other transactions or non-transactional reads until commit succeeds.
Constructors
- NSTransaction.begin(NSDatabase database)
-
Begin a new transaction on
database.factory
Properties
-
handle
→ Pointer<
ns_transaction_t> -
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isFinished → bool
-
Whether commit or rollback has already been called.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
commit(
) → void - Persist buffered changes and end this transaction.
-
delete(
NSKey key) → bool - Buffer a delete in this transaction.
-
get(
NSKey key) → NSEntity? - Read an entity within this transaction's snapshot.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
put(
NSEntity entity) → void - Buffer a write in this transaction.
-
query(
String tableName, {List< String> ? orderBy}) → NSQuery -
Start building a query against
tableNamewithin this transaction. -
rollback(
) → void - Discard buffered changes and end this transaction.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited