One word of warning, I did something similar opening and closing lots of
connections to a SQL Server database, and it just about brought the
database to it's knees.
As a result, I ended up writing a simple server that kept one or two
connections to the database open all the time, and allowed my remote
processes to talk to it to update and query the database through socket
calls to the server. I don't think this is the best possible solution, but
it did solve a need.
I have never had problems like that with SQLite.
Thanks,
Greg Givler
Information Technology
Lockwood®
10 Valley Stream Parkway
Malvern, PA 19355
Phone: (484) 605-4826
Email: [email protected]
Kyle Stevens <[email protected]>
Sent by: pysqlite-bounces-IAPFreCvJWPBWskQ1e/[email protected]
09/16/2007 09:13 PM
Please respond to
pysqlite list <pysqlite-IAPFreCvJWPBWskQ1e/[email protected]>
To
pysqlite-IAPFreCvJWPBWskQ1e/[email protected]
cc
Subject
[pysqlite] Closing Connections between Queries
At my job, I work on an application that was started by someone else.
It has a few main database functions, NonQuery(sql), GetValue(sql),
CheckValue(sql), whose purposes should be self explanatory. Every time
one of these functions are called, it creates a new database connection,
does it's business, and closes the connection. The application in
question is actually in Visual Basic, but the question remains valid for
an application I want to start with Python and SQLite. Is it best to
open and close the connection on each query, or should the connection
remain open throughout the life of the application? Also, does the
answer differ depending on the DBMS used or whether it is a single user
or multi user environment?
Any comments or suggestions would be greatly appreciated.
Thanks,
-Kyle Stevens
_______________________________________________
pysqlite mailing list
pysqlite-IAPFreCvJWPBWskQ1e/[email protected]
http://lists.initd.org/mailman/listinfo/pysqlite
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please call the help desk at ext 4850
______________________________________________________________________
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
_______________________________________________
pysqlite mailing list
pysqlite-IAPFreCvJWPBWskQ1e/[email protected]
http://lists.initd.org/mailman/listinfo/pysqlite
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.