Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1a.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.021 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'happens.': 0.09; 'here?': 0.09; 'sure,': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'mean,': 0.16; 're-read': 0.16; 'stuff,': 0.16; 'unlikely': 0.16; 'wrote:': 0.18; 'starts': 0.20; 'work,': 0.20; 'cc:addr:python.org': 0.22; 'creating': 0.23; 'specifies': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'bunch': 0.31; 'open': 0.33; 'fri,': 0.33; 'transaction': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'material': 0.36; 'nov': 0.38; 'anything': 0.39; 'system.': 0.39; 'how': 0.40; 'ian': 0.60; 'logs': 0.60; 'impact': 0.61; "you're": 0.61; 'show': 0.63; 'statement,': 0.68; '4:26': 0.84; '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=xtKi3e7asGUHmRI3BnOttM24HoEIG2P/iWW/oWKe7wQ=; b=HfQnpODx1QlqmSPb/TwZJfGO1JMxBrXKRjRcGm/DxALVqB12q4uE6T86SloGH0CXS5 1bAC0Z56td3lMm7DHDR6E5dFk58MtplluHER+qLFkNtZbxpql5YAbx34uUSeKFV+Qa4A deATw/5MnIAPaYujQeeN6zH+PxRTfyeirYuJO1kzipkbkxQSzel/onWUt1iiL3Flx6s2 HObY4xJfGaIYDWriJR1kg00We5KfL7LJX5IDQkNC1UrxyGGKLFVxRa9jPLbz0jDZUUIK y4HnXcJo2Ypf9+FCBrsTS1i0aNJshp7wTZgK9zI+uL1Yph/OYABUHBbWp4iXjEvLazVL I8nA== MIME-Version: 1.0 X-Received: by 10.107.134.39 with SMTP id i39mr36080380iod.53.1417127813928; Thu, 27 Nov 2014 14:36:53 -0800 (PST) In-Reply-To: References: Date: Fri, 28 Nov 2014 09:36:53 +1100 Subject: Re: Db transactions and locking From: Chris Angelico Cc: Python 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: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1417127816 news.xs4all.nl 2850 [2001:888:2000:d::a6]:46065 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:81650 On Fri, Nov 28, 2014 at 5:02 AM, Ian Kelly wrote: > On Nov 27, 2014 4:26 AM, "Frank Millman" wrote: >> All Python database adaptors that I have used start a transaction when you >> open a cursor. I have just re-read DB-API 2.0, and I cannot see anything >> that specifies this behaviour, but AFAICT this is what happens. > > I don't know how others work, but cx_Oracle starts a transaction when you > execute a statement, not when you open a cursor. Is there any material difference here? I mean, sure, you have a transaction, it'll show up in logs and stuff, but without any locks, it's unlikely to have much impact on the system. Unless you're creating and destroying a bunch of unnecessary cursors all the time, of course, but that'd be wasteful for other reasons. ChrisA