On 23 Gen, 23:43, Rick Morrison <rickmorri...@gmail.com> wrote:
> From your earlier post:
>
>
>
> > a_session.close()
> > sa_Session.close_all()
> > sa_engine.dispose()
>      ....
> > del sa_engine
> > but it does not close the connection!
>
> Here's Engine.dispose (line 1152, engine/base.py)
>
>     def dispose(self):
>         self.pool.dispose()
>         self.pool = self.pool.recreate()
>
> ..and here's QueuePool.dispose (the default pool, line 646, pool.py)
>
>     def dispose(self):
>         while True:
>             try:
>                 conn = self._pool.get(False)
>                 conn.close()
>             except Queue.Empty:
>                 break
>
>         self._overflow = 0 - self.size()
>         if self._should_log_info:
>             self.log("Pool disposed. " + self.status())
>
> So the normal path would be to indeed close the connection (but not
> necessarily to delete the connection itself, it just falls out of scope).
> Can you trace into the dispose() call and verify that these are being run?

Hey, seems that you've got the problem. conn = self._pool.get( False )
is the problem....
It raises an Empty error...:

File "E:\test.py", line 175, in <module>
  Data.sa_engine.dispose()
File "c:\Python25\Lib\site-packages\sqlalchemy-0.4.8-py2.5.egg
\sqlalchemy\engine\base.py", line 1133, in dispose
  self.pool.dispose()
File "C:\Python25\Lib\site-packages\sqlalchemy-0.4.8-py2.5.egg
\sqlalchemy\pool.py", line 626, in dispose
  conn = self._pool.get(False)
File "c:\Python25\Lib\site-packages\sqlalchemy-0.4.8-py2.5.egg
\sqlalchemy\queue.py", line 140, in get
  raise Empty
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to