View source on GitHub |
A class that manages the state of transactions.
Inherits From: expected_type
google.appengine.datastore.datastore_stub_util.BaseTransactionManager(
consistency_policy=None
)
This includes creating consistent snap shots for transactions.
Methods
BeginTransaction
BeginTransaction(
app,
allow_multiple_eg,
previous_transaction=None,
mode=datastore_pb.BeginTransactionRequest.UNKNOWN
)
Start a transaction on the given app.
Args | |
---|---|
app
|
A string representing the app for which to start the transaction. |
allow_multiple_eg
|
True if transactions can span multiple entity groups. |
previous_transaction
|
The transaction to reset. |
mode
|
Mode of the transaction. |
Returns | |
---|---|
A datastore_pb.Transaction() for the created transaction |
Clear
Clear()
Discards any pending transactions and resets the meta data.
Flush
Flush()
Applies all outstanding transactions.
GetTxn
GetTxn(
transaction, request_trusted, request_app
)
Gets the LiveTxn object associated with the given transaction.
Args | |
---|---|
transaction
|
The datastore_pb.Transaction() to look up. |
request_trusted
|
A boolean indicating If the requesting app is trusted. |
request_app
|
A string representing the app making the request. |
Returns | |
---|---|
The associated LiveTxn object. |
Groom
Groom()
Attempts to apply any outstanding transactions.
The consistency policy determins if a transaction should be applied.
SetConsistencyPolicy
SetConsistencyPolicy(
policy
)
Set the consistency to use.
Causes all data to be flushed.
Args | |
---|---|
policy
|
A obj inheriting from BaseConsistencyPolicy. |