You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 25, 2023. It is now read-only.
What steps will reproduce the problem?
from google.appengine.ext import ndb
from google.appengine.ext import db
class Test(db.Model):
pass
@ndb.non_transactional
def bystander():
Test().put()
@ndb.tasklet
def txn():
bystander()
@ndb.synctasklet
def main():
yield ndb.transaction_async(txn)
main()
What is the expected output? What do you see instead?
The code should successfully put the Test entity outside the transaction.
Instead, it crashes with an AttributeError because the Test().put() attempts to
use a datastore connection with the ndb adapter.
What version of the product are you using? On what operating system?
1.7.3, OS X
Please provide any additional information below.
A workaround is to manually reset the connection with
datastore._SetConnection(None) as the first line of a non_transactional
function. It would probably be better to restore the original datastore
connection but that's held in a local variable in Context.transaction and not
accessible.
Original issue reported on code.google.com by pi...@knowlabs.com on 6 Jan 2013 at 12:57
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
pi...@knowlabs.com
on 6 Jan 2013 at 12:57The text was updated successfully, but these errors were encountered: