web.connect

0 views
Skip to first unread message

BjornT

unread,
Apr 8, 2008, 12:20:08 AM4/8/08
to web.py
Hi,

I don't see a web.close anywhere after I web.connect. Do I not
manually close a connection? I was going through the code in db.py and
I don't even see any where the cursor is being closed. What's going
on?

Aaron Swartz

unread,
Apr 8, 2008, 1:26:58 AM4/8/08
to we...@googlegroups.com
1. Most people use DB pooling.
2. Cursors get closed when they're garbage collected.
3. If you really need to, you can do web.ctx.db.close() or
web.ctx.db.cursor.close() I think.

BjornT

unread,
Apr 8, 2008, 1:41:39 AM4/8/08
to web.py
Yeah I'm using DBUtils so I'm pooling I guess. Just wondering. I'm so
used to C style closing of resources.
Reply all
Reply to author
Forward
0 new messages