#565: Using models and turbogears AutoConnectHub with threads
-------------------------------------------+--------------------------------
 Reporter:  jpaulofarias at gmail dot com  |        Owner:  anonymous
     Type:  defect                         |       Status:  closed   
 Priority:  high                           |    Milestone:  0.9      
Component:  TurboGears                     |      Version:           
 Severity:  critical                       |   Resolution:  invalid  
 Keywords:                                 |  
-------------------------------------------+--------------------------------
Changes (by kevin):

  * status:  reopened => closed
  * resolution:  => invalid

Comment:

 Actually, I hadn't tried conntest. What I did was:

 1) set server.thread_pool=10
 2) ab -c 5 -n 20 http://localhost:8080/FrontPage (on a wiki 20)
 3) mysql-admin processlist

 Doing this and repeating #2-3 as desired, the mysql connection count stuck
 at 5, showing a definite use of a connection pool.

 I just looked at conntest. It's not a normal use case. The common use case
 is that TurboGears creates the threads for you and manages that database
 connections/transactions. In this case, you created your own threads.

 The reason those connections were hanging around is that TG provides
 implicit transactions in 0.9. So, the transactions were being created but
 never closed. I added one line to conntest's controllers.py and all was
 well:

 {{{
 def simpleThreadTest():
     obj = TestClass(test='creating an object')
     time.sleep(1)
     hub.end()
 }}}

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