Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60689 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71763 invoked from network); 29 May 2012 20:58:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 May 2012 20:58:05 -0000 Authentication-Results: pb1.pair.com header.from=glopes@nebm.ist.utl.pt; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=glopes@nebm.ist.utl.pt; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain nebm.ist.utl.pt from 193.136.128.21 cause and error) X-PHP-List-Original-Sender: glopes@nebm.ist.utl.pt X-Host-Fingerprint: 193.136.128.21 smtp1.ist.utl.pt Linux 2.6 Received: from [193.136.128.21] ([193.136.128.21:34131] helo=smtp1.ist.utl.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8F/B5-36789-A5835CF4 for ; Tue, 29 May 2012 16:58:03 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp1.ist.utl.pt (Postfix) with ESMTP id 3340E70003F3; Tue, 29 May 2012 21:57:59 +0100 (WEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at ist.utl.pt Received: from smtp1.ist.utl.pt ([127.0.0.1]) by localhost (smtp1.ist.utl.pt [127.0.0.1]) (amavisd-new, port 10025) with LMTP id bcZYdl2sUrAe; Tue, 29 May 2012 21:57:58 +0100 (WEST) Received: from mail2.ist.utl.pt (mail.ist.utl.pt [IPv6:2001:690:2100:1::8]) by smtp1.ist.utl.pt (Postfix) with ESMTP id CA43670003E9; Tue, 29 May 2012 21:57:58 +0100 (WEST) Received: from damnation.mshome.net (damnation-air.nl.lo.geleia.net [IPv6:2001:470:94a2:4:7d06:1af1:ea64:2d52]) (Authenticated sender: ist155741) by mail2.ist.utl.pt (Postfix) with ESMTPSA id 051512009011; Tue, 29 May 2012 21:57:56 +0100 (WEST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "internals@lists.php.net" , "Christian Ferrari" References: <1338323273.24780.YahooMailNeo@web29506.mail.ird.yahoo.com> Date: Tue, 29 May 2012 22:57:53 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Organization: =?utf-8?Q?N=C3=BAcleo_de_Eng=2E_Biom=C3=A9di?= =?utf-8?Q?ca_do_I=2ES=2ET=2E?= Message-ID: In-Reply-To: <1338323273.24780.YahooMailNeo@web29506.mail.ird.yahoo.com> User-Agent: Opera Mail/11.64 (Win32) Subject: Re: [PHP-DEV] PHP and two phase commit transactions From: glopes@nebm.ist.utl.pt ("Gustavo Lopes") On Tue, 29 May 2012 22:27:53 +0200, Christian Ferrari wrote: > > These are the issues I partially solved integrating LIXA with PHP. > > 1. > XA interface is a C level interface: the PHP database drivers must be > changed at C source level to avoid many leaps between C and PHP code. > The most important PHP database drivers are distributed with PHP core > itself => patching their source code is equivalent to patch PHP core. > 2. As a consequence of the first point, the LIXA PHP wrapper itself > should > be distributed with PHP core to avoid dependencies between some core > extensions and an external extension. > 3. The TX API does not deal > with the concept of "connection" because it's implicit: every > process/thread has its own connection with every Resource Manager > (database). Better explained: tx_open(), tx_begin(), tx_commit(), > tx_rollback(), tx_close() (and so on...) do not specify the handlers > necessary to distinguish connection objects. > 4. The TX API design does not take into account the concept of > "persistent connections" and "connection pooling". > > I afforded issues 1 and 2 creating a global experimental patch for PHP > core itself (you can find it in "ext/php" directory of LIXA tarball or > directly at SVN repository. > http://lixa.svn.sourceforge.net/viewvc/lixa/ext/php/). > Issue number 3 was bypassed and, for the sake of trivial "hello world > equivalent examples", the integration seems to work properly. > Issue 4 is quite difficult to address: I ignored "persistent connection" > disabling LIXA feature when the application asks a persistent > connection, but I was not able to deal with Oracle "connection pools" of > oci8 driver. > I have some concerns about the approach you're taking. I don't think a compile time dependency to LIXA is acceptable. Can't you add some hooks to the several database extensions? From a glance at your patch, it seems you only need to change the behavior when getting a new connection and closing one. This shouldn't be much work. Once that were done, one would be able to plug the LIXA extension (or any similar extension). I don't think this approach would get objections from the extension maintainers and it is more versatile. -- Gustavo Lopes