pysqlite connection

31 views
Skip to first unread message

mrtn...@gmail.com

unread,
Jan 27, 2013, 1:45:56 PM1/27/13
to python...@googlegroups.com

Hi, i'm new to sqlite and pysqlite, and have a simple question: is a connection in pysqlite persistent? in other words, if i make a connection to the db, and do nothing, would that connection be dropped after a period of idleness? Some other dbs may enforce a timeout option on connections, which drops idle connections periodically.

Roger Binns

unread,
Jan 27, 2013, 4:09:05 PM1/27/13
to python...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 27/01/13 10:45, mrtn...@gmail.com wrote:
> is a connection in pysqlite persistent? in other words, if i make a
> connection to the db, and do nothing, would that connection be dropped
> after a period of idleness? Some other dbs may enforce a timeout option
> on connections, which drops idle connections periodically.

SQLite connections are persistent and it will never drop connections or do
similar timeouts. Other databases that do drop connections do so because
the database server is running as a separate process probably on a
separate machine and communication is over the network. Each connection
consumes server resources which are finite hence the desire to eventually
kick the idle clients out.

By contrast SQLite is a library that runs in the same process as your app.
There is no networking involved. Any resource consumption is inside the
same app.

Here are some other tips for using SQLite:

http://apidoc.apsw.googlecode.com/hg/tips.html

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAlEFl2wACgkQmOOfHg372QRvvgCgg4ePIGZ5ZUBJNeAbluluDXdK
bZEAoK5pjg8NvJqJu55S5YEks6WC3luU
=Qph4
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
0 new messages