The datastore sets the entity group of a transaction automatically. I would like to find out what this is set to while I am inside the transaction. To elaborate, suppose I have the following function foo
that runs in a transaction:
@ndb.transactional
def foo():
bar1()
bar2()
bar1
performs some actions on the datastore. It gets, puts, create entities, runs queries etc. Since bar1
is running inside a transaction all the actions that it performs, and queries it runs, must be restricted to an single entity group, as per the strictly enforced requirement of the datastore API (lets assume this is not a XG transaction).
Now in bar2
I want to programmatically determine what entity group of the transaction is. I do not have any information about what went on in bar1
.
Is this possible?
Mainly I want this for testing, and understanding how and when the entity group for a transaction is set.
I could not find a way to do this from the official documentation.