#872: MySQLdb/gears  does not reconnect if mysql drops connection
-------------------------------+--------------------------------------------
 Reporter:  [EMAIL PROTECTED]  |        Owner:  anonymous
     Type:  defect             |       Status:  new      
 Priority:  high               |    Milestone:  0.9      
Component:  SQLObject          |      Version:  0.9a5    
 Severity:  major              |   Resolution:           
 Keywords:                     |  
-------------------------------+--------------------------------------------
Comment (by [EMAIL PROTECTED]):

 Just to add - postgres exhibits a similar problem ( at least with sessions
 ) -- but seems to reconnect after an invalid request

 A workaround I found that seems to be working, is to use tg scheduler as
 such:

 {{{
 import psycopg2
 def get_db_for_sessions():
     dsn = get('sessions.postgres.dsn')
     return psycopg2.connect(dsn)

 def _session_db_ping():
     print "_session_db_ping"
     x= get_db_for_sessions()

 add_interval_task( action=_session_db_ping, taskname='_session_db_ping',
 initialdelay=0, interval=270 )
 }}}

 that pings the db by calling a connect every 4.5 minutes -- it would
 probably work with mysql

-- 
Ticket URL: <http://trac.turbogears.org/turbogears/ticket/872>
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to