Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.053 X-Spam-Evidence: '*H*': 0.89; '*S*': 0.00; 'sure,': 0.09; 'cc:addr :python-list': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'logical.': 0.16; 'wrote:': 0.18; 'commit': 0.19; 'seems': 0.21; 'command': 0.22; 'cc:addr:python.org': 0.22; 'tells': 0.24; 'cc:2**0': 0.24; 'source': 0.25; 'header:In-Reply- To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'another': 0.32; 'fri,': 0.33; "can't": 0.35; 'but': 0.35; 'received:google.com': 0.35; 'next': 0.36; 'starting': 0.37; 'nov': 0.38; 'pm,': 0.38; 'does': 0.39; 'transaction.': 0.60; 'new': 0.61; 'frank': 0.68; 'therefore': 0.72; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=K8qv2TZAzJRHCqjwj1hIVDXtCh5HzvFCH9gDqGVd/bs=; b=sVplpgMSOhw3hQQVIdy6df3ptuHIsSuX2MxF9PCpjn5oInNQUy9LQknm09/nsSllZI FzsFeCnYt9GGRWThI989p/vQzDu6kTQVsLeJPCU/X163lDVuNy357yoiZ8O6F960Cxyy VxHgK/I6uZSBowxXBa+SH/qCmSOnqjpKyeJmr1vT4BinqTAYfuJJa0lxClUaXfUoIS2U lK8Dxybv4S+ZwgQDzvX+boCHTciVmBZXA5qe7cNPeoAmSeH0jY8TdpuKkMudGorYr7Pt mI2/+YLuWktDqtN6CrMz2FAfowGvn9vJH1womSurqDQT2oWU0oTopbrwpyBp9NZupbrQ ReuA== MIME-Version: 1.0 X-Received: by 10.152.87.67 with SMTP id v3mr40274659laz.97.1417157931025; Thu, 27 Nov 2014 22:58:51 -0800 (PST) In-Reply-To: References: <4loe7at2ls7tfq0oe041ru9svvsm8aksik@4ax.com> Date: Fri, 28 Nov 2014 17:58:50 +1100 Subject: Re: Db transactions and locking From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 11 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1417157933 news.xs4all.nl 2913 [2001:888:2000:d::a6]:39186 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:81670 On Fri, Nov 28, 2014 at 5:57 PM, Frank Millman wrote: > cur.execute('commit') tells the database to commit the transaction, but the > adaptor is not aware of this, so does not reset. Therefore the next command > does not trigger starting a new transaction. > > I have now learned another lesson - never use cur.execute('commit'), always > use conn.commit() Without looking in the source I can't be sure, but that seems very logical. ChrisA