Skip to content
This repository has been archived by the owner on Dec 25, 2023. It is now read-only.

Add ndb.non_transaction(...) #230

Open
GoogleCodeExporter opened this issue Jun 10, 2015 · 3 comments
Open

Add ndb.non_transaction(...) #230

GoogleCodeExporter opened this issue Jun 10, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

NDB provides ndb.transaction(callback, **ctx_options) and 
ndb.transaction_async(callback, **ctx_options) functions to go with the 
@ndb.transactional decorator.

Please also provide ndb.non_transaction_async(callback, **ctx_options) and 
ndb.non_transaction(callback, **ctx_options) functions to go with the 
@ndb.non_transactional decorator for completeness and to safely allow the 
running of non transactional code within tasklets.

See 
http://stackoverflow.com/questions/13878594/non-transactional-operations-in-a-tr
ansactional-tasklet and 
http://code.google.com/p/appengine-ndb-experiment/issues/detail?id=195&colspec=I
D%20Type%20Status%20Priority%20Milestone%20Owner%20Summary%20Stars for further 
information.

Original issue reported on code.google.com by [email protected] on 15 Dec 2012 at 6:35

@GoogleCodeExporter
Copy link
Author

@non_transactional_aync would not actually be useful as @non_transactional just 
reconfigures local context state.

@ndb.non_transactional
@ndb.tasklet
def non_transactional_tasklet():
  ...

should work today and

@ndb.transactional_async
@ndb.tasklet
def transactional_tasklet():
  ...

will work as soon as 1.8.3 is out.

Thought it might be useful to add a normal function version of 
@non_transactional, though you can do that today using:
ndb.non_transactional(callback, ...)()

Original comment by [email protected] on 19 Jul 2013 at 10:31

  • Added labels: Priority-Low
  • Removed labels: Priority-Medium

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 19 Jul 2013 at 10:31

  • Changed title: Add ndb.non_transaction(...)

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 19 Jul 2013 at 10:34

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants