limeuser / appengine-ndb-experiment

Automatically exported from code.google.com/p/appengine-ndb-experiment
Other
0 stars 0 forks source link

Add ndb.non_transaction(...) #230

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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 uvico...@gmail.com on 15 Dec 2012 at 6:35

GoogleCodeExporter commented 9 years ago
@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 arful...@google.com on 19 Jul 2013 at 10:31

GoogleCodeExporter commented 9 years ago

Original comment by arful...@google.com on 19 Jul 2013 at 10:31

GoogleCodeExporter commented 9 years ago

Original comment by arful...@google.com on 19 Jul 2013 at 10:34