Changeset 2880
- Timestamp:
- 04/21/07 07:19:24 (2 years ago)
- Files:
-
- branches/1.0/CHANGELOG.txt (modified) (2 diffs)
- branches/1.0/turbogears/database.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0/CHANGELOG.txt
r2878 r2880 7 7 *Changes* 8 8 9 * SA transaction object is now stored at ``cherrypy.request.sa_transaction`` so it 10 can be accessed from the controllers. Patch at #1359 by Janzert. 9 11 * SecureResource now raises an AttributeError when no require attribute is 10 12 present in the controller class or in the config file. Closes #1336. … … 55 57 *Contributors* 56 58 57 Alberto Valverde, Fred Lin, jorge.vargas, Joseph Tate, Elvelind Grandin, Florent Aide, nludban, Jeff Kowalczyk, corvus, Christoph Zwerschke, iberonasia, alastair, cito, Felix Schwartz, Patrcik Lewis, Grover, pnfisher, Joost Moesker, Paul Johnston, Christian Vogler .59 Alberto Valverde, Fred Lin, jorge.vargas, Joseph Tate, Elvelind Grandin, Florent Aide, nludban, Jeff Kowalczyk, corvus, Christoph Zwerschke, iberonasia, alastair, cito, Felix Schwartz, Patrcik Lewis, Grover, pnfisher, Joost Moesker, Paul Johnston, Christian Vogler, Janzert. 58 60 59 61 branches/1.0/turbogears/database.py
r2874 r2880 338 338 def sa_rwt(func, *args, **kw): 339 339 log.debug("New SA transaction") 340 transaction = session.create_transaction() 340 req = cherrypy.request 341 req.sa_transaction = session.create_transaction() 341 342 try: 342 343 retval = func(*args, **kw) 343 transaction.commit()344 req.sa_transaction.commit() 344 345 except (cherrypy.HTTPRedirect,cherrypy.InternalRedirect): 345 346 try: 346 transaction.commit()347 req.sa_transaction.commit() 347 348 except Exception,e: 348 349 retval = dispatch_exception(e,args,kw) … … 350 351 raise 351 352 except Exception, e: 352 transaction.rollback()353 req.sa_transaction.rollback() 353 354 retval = dispatch_exception(e,args,kw) 354 355 return retval