#1185: controller method trying to flush the database session(sqlalchemy) even 
if
exception occours
------------------------+---------------------------------------------------
 Reporter:  sanjay      |        Owner:  anonymous
     Type:  defect      |       Status:  new      
 Priority:  normal      |    Milestone:           
Component:  unassigned  |      Version:  1.0b1    
 Severity:  normal      |   Resolution:           
 Keywords:              |  
------------------------+---------------------------------------------------
Comment (by sanjay):

 Hi Alberto,

 Thanks a lot for the elaborative explaination and the patch.

 I tried session.clear() like this:

 {{{
 def index(self, ...):
     if tg_excpetions:
         flash("Exception: " + str(tg_exceptions))
         session.clear()
         cherrypy.request.my_exc = tg_exceptions
 }}}

 It worked perfectly.

 I have two layman doubts, though:

 1. Will not clearing the session affect other requests, i.e. is session
 not shared with other requests?

 2. Could not make out the use of adding this line:
 {{{cherrypy.request.my_exc = tg_exceptions}}}

 Then, after applying the patch, while I tried

 {{{
 def index(self, ...):
     if tg_excpetions:
         flash("Exception: " + str(tg_exceptions))
         cherrypy.request.tg_sa_transaction.rollback()
 }}}

 it did not seem working. The behaviour remained unchanged.

 thanks
 sanjay

-- 
Ticket URL: <http://trac.turbogears.org/turbogears/ticket/1185>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"TurboGears Tickets" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-tickets?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to