Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47263 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61993 invoked from network); 14 Mar 2010 13:15:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Mar 2010 13:15:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=wez@netevil.org; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=wez@netevil.org; sender-id=pass Received-SPF: pass (pb1.pair.com: domain netevil.org designates 8.8.38.76 as permitted sender) X-PHP-List-Original-Sender: wez@netevil.org X-Host-Fingerprint: 8.8.38.76 unknown Solaris 10 (beta) Received: from [8.8.38.76] ([8.8.38.76:56903] helo=zimbrafree.office.omniti.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 12/10-61169-781EC9B4 for ; Sun, 14 Mar 2010 08:15:52 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbrafree.office.omniti.com (Postfix) with ESMTP id 68C0BBDF1; Sun, 14 Mar 2010 09:15:48 -0400 (EDT) Received: from zimbrafree.office.omniti.com ([127.0.0.1]) by localhost (zimbrafree.office.omniti.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5spleEjjGc70; Sun, 14 Mar 2010 09:15:44 -0400 (EDT) Received: from [192.168.50.15] (c-68-54-255-27.hsd1.md.comcast.net [68.54.255.27]) by zimbrafree.office.omniti.com (Postfix) with ESMTP id 9A35EBDEE; Sun, 14 Mar 2010 09:15:43 -0400 (EDT) To: Jess Portnoy In-Reply-To: <4B9C9BA6.3020405@zend.com> References: <1268552350.11885.76099.camel@localhost> <4B9C96E2.8060500@zend.com> <1268554481.11885.76215.camel@localhost> <4B9C9BA6.3020405@zend.com> Message-ID: <3DA0059E-C8E4-4B82-B977-17FE65932BB0@netevil.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v936) Date: Sun, 14 Mar 2010 09:15:37 -0400 Cc: Mark Karpeles , PHP Developers Mailing List , wez@php.net X-Mailer: Apple Mail (2.936) Subject: Re: [PHP-DEV] Req #51295: busyTimeout method for SQLite3 From: wez@netevil.org (Wez Furlong) I'm sure that the docs team will add this to the manual if you ask =20 them politely. Specifically, PDO_SQLITE defaults to a 60 second busy timeout. This =20 can be changed by setting PDO::ATTR_TIMEOUT. The value is specified =20 in seconds. ISTR that this option can also be specified for some of the other =20 database drivers to affect the network timeout when processing a query. --Wez. On Mar 14, 2010, at 4:17 AM, Jess Portnoy wrote: > Hi Mark, > > I agree but I'm not the maintainer for PDO_SQLITE, I just happen to =20= > know it somewhat and thought it can be useful to you as reference. I =20= > am CCing Wez Furlong who I believe is the lead for it. > > May the source be with you, > Best regards, > Jess Portnoy > > > > Mark Karpeles wrote: >> Hi, >> >> I checked around PDO (which I don't use at all, but the source is >> usually a good documentation). >> >> The timeout can be changed for SQLite and SQLite3 PDO drivers with: >> >> $pdo->setAttribute(PDO::ATTR_TIMEOUT, ) >> >> I see that PDO::ATTR_TIMEOUT is not documented on >> http://php.net/manual/en/pdo.setattribute.php - it might be a good =20= >> idea >> to fix this :) >> >> >> Mark >> >> Le dimanche 14 mars 2010 =E0 09:57 +0200, Jess Portnoy a =E9crit : >> >>> Hello Mark, >>> >>> Note that while indeed sqlite3_busy_timeout() is not extended by =20 >>> the SQLite3 and PDO_SQLITE extensions, it is called internally in =20= >>> ext/pdo_sqlite/sqlite_driver.c. >>> I think it is a good idea to extend it but also, that if you do, =20 >>> it should probably also be done for PDO_SQLITE as it may be useful =20= >>> there as well. >>> >>> May the source be with you, >>> Best regards, >>> Jess Portnoy >>> >>> >>> >>> Mark Karpeles wrote: >>> >>>> Hello, >>>> >>>> I've been encountering a problem with SELECT queries and SQLite3 =20= >>>> as load >>>> was growing on my system. =46rom times to times I was getting this =20= >>>> error: >>>> >>>> Warning: SQLite3Stmt::execute(): Unable to execute statement: =20 >>>> database >>>> is locked >>>> >>>> After searching on google I saw I should call =20 >>>> sqlite3_busy_timeout() and >>>> found out that there was no way to call it from the SQLite3 =20 >>>> extension >>>> (which is new to PHP 5.3.x). >>>> >>>> Here's a patch that will add this method to the SQLite3 class: >>>> >>>> http://bugs.php.net/51295 >>>> https://ookoo.org/svn/snip/php_5_3-sqlite3-busytimeout-method.patch >>>> >>>> Any comment welcome. >>>> >>>> >>>> Mark >>>> >>>> >>>> >> >> >>