|Modifier and Type||Method and Description|
Returns the current transaction for this thread, or throws an exception if there is no current transaction.
Returns the current transaction for this thread, or returns the parameter if there is no current transaction.
Prepares a query for execution.
Exhibits the same behavior as
PreparedQuery prepare(Query query)
This method returns a
PreparedQuery which can be used
to execute and retrieve results from the datastore for
This operation will not execute in a transaction even if there is a current
transaction and the provided query is an ancestor query. This operation
also ignores the
ImplicitTransactionManagementPolicy. If you are
preparing an ancestory query and you want it to execute in a transaction,
query- a not
PreparedQuery prepare(Transaction txn, Query query)
prepare(Query), but executes within the provided transaction. It is up to the caller to commit or rollback. Transaction can be null.
java.lang.IllegalArgumentException- If txn is not null and query is not an ancestor query
java.lang.IllegalStateException- If txn is not null and the txn is not active
java.util.NoSuchElementException- If there is no current transaction.
Transaction getCurrentTransaction(Transaction returnedIfNoTxn)
nullor provide your own object to represent null. See
getCurrentTransaction()for a definition of "current transaction." Use this method when you're not sure if there is a current transaction.
returnedIfNoTxn- The return value of this method if there is no current transaction. Can be null.