Changeset 2880

Show
Ignore:
Timestamp:
04/21/07 07:19:24 (2 years ago)
Author:
alberto
Message:

Applied patch at #1359 by Janzert

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0/CHANGELOG.txt

    r2878 r2880  
    77*Changes* 
    88 
     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. 
    911* SecureResource now raises an AttributeError when no require attribute is 
    1012  present in the controller class or in the config file. Closes #1336. 
     
    5557*Contributors* 
    5658 
    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
     59Alberto 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
    5860 
    5961 
  • branches/1.0/turbogears/database.py

    r2874 r2880  
    338338def sa_rwt(func, *args, **kw): 
    339339    log.debug("New SA transaction") 
    340     transaction = session.create_transaction() 
     340    req = cherrypy.request 
     341    req.sa_transaction = session.create_transaction() 
    341342    try: 
    342343        retval = func(*args, **kw) 
    343         transaction.commit() 
     344        req.sa_transaction.commit() 
    344345    except (cherrypy.HTTPRedirect,cherrypy.InternalRedirect): 
    345346        try: 
    346             transaction.commit() 
     347            req.sa_transaction.commit() 
    347348        except Exception,e: 
    348349            retval = dispatch_exception(e,args,kw) 
     
    350351            raise 
    351352    except Exception, e: 
    352         transaction.rollback() 
     353        req.sa_transaction.rollback() 
    353354        retval = dispatch_exception(e,args,kw) 
    354355    return retval