Re: Threading issue with SQLite

2010-02-02 Thread Alan Harris-Reid
Many thanks to all who replied to my questions re. SQLite connections, cursors and threading. Looks like I have got some reading to do regarding connection pooling and a decent SQLite ORM package. Does anyone know of any which are Python 3 compatible? Many thanks, Alanj -- http://mail.pyth

Re: Threading issue with SQLite

2010-01-30 Thread John Nagle
Jonathan Gardner wrote: On Jan 29, 8:37 am, Alan Harris-Reid wrote: Questions... 1. Is there a large overhead in opening a new SQLite connection for each thread (ie. within each method)? Suggestion: Use something like SQLAlchemy to manage you DB interactions. One day, you'll move away from

Re: Threading issue with SQLite

2010-01-29 Thread Stephen Hansen
On Fri, Jan 29, 2010 at 8:37 AM, Alan Harris-Reid < aharrisr...@googlemail.com> wrote: > Hi, > > I am creating a web application (using Python 3.1 and CherryPy 3.2) where a > SQLite connection and cursor object are created using the following code > (simplified from the original): > > class MainSi

Re: Threading issue with SQLite

2010-01-29 Thread Jonathan Gardner
On Jan 29, 8:37 am, Alan Harris-Reid wrote: > > Questions... > 1.  Is there a large overhead in opening a new SQLite connection for > each thread (ie. within each method)? Yes, but not as bad as some other DBs. > 2.  Is there any way to use the same connection for the whole class (or > should I

Threading issue with SQLite

2010-01-29 Thread Alan Harris-Reid
Hi, I am creating a web application (using Python 3.1 and CherryPy 3.2) where a SQLite connection and cursor object are created using the following code (simplified from the original): class MainSite: con = sqlite.connect('MyDatabase.db') cursor = con.cursor() def index_page():