Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #15388

Re: Question about 'iterable cursors'

From Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject Re: Question about 'iterable cursors'
Date 2011-11-06 12:04 -0800
Organization > Bestiaria Support Staff <
References <mailman.2460.1320569710.27778.python-list@python.org> <87pqh54nmh.fsf@dpt-info.u-strasbg.fr> <j95kld$ng4$1@dough.gmane.org>
Newsgroups comp.lang.python
Message-ID <mailman.2472.1320609864.27778.python-list@python.org> (permalink)

Show all headers | View raw


On Sun, 6 Nov 2011 11:39:56 +0200, "Frank Millman" <frank@chagford.com>
declaimed the following in gmane.comp.python.general:

> 
> So my analysis of the problem is correct, but my solution is wrong.
> 
> Instead of executing fetchall() and returning the connection, I should 
> retain the connection until I have exhausted the cursor.
> 
> That makes a lot of sense.
>
	Especially if all you are processing are read-only activities.

	If you have a connection/cursor doing write operations, you may not
be able to commit those writes until all reading cursors have closed.
(Read the documentation on the SQLite3 locking system -- though the
newest version has added a second type of locking which may complicate
the matter. The original/normal scheme has potential readers "outside"
SQLite3, active readers "inside" SQLite3 -- when an active reader cursor
advances to a pending write, it blocks all the potential readers from
entering, but is itself blocked until all other active readers have
exited)
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
        wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Question about 'iterable cursors' "Frank Millman" <frank@chagford.com> - 2011-11-06 10:54 +0200
  Re: Question about 'iterable cursors' Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2011-11-06 10:16 +0100
    Re: Question about 'iterable cursors' "Frank Millman" <frank@chagford.com> - 2011-11-06 11:39 +0200
    Re: Question about 'iterable cursors' Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-11-06 12:04 -0800
      Re: Question about 'iterable cursors' John Nagle <nagle@animats.com> - 2011-11-06 22:04 -0800
        Re: Question about 'iterable cursors' Lie Ryan <lie.1296@gmail.com> - 2011-11-08 16:29 +1100

csiph-web