On Wed, 30 May 2012 22:10:56 +0200, Christian Ferrari <cam...@yahoo.com> wrote:

You correctly understood the only necessary changes are related to open/close connection to the resource manager (database); this is a consequence of XA and TX specifications. I've not completely understood your statement "add some hooks to the several database extensions" and I would need some more details; is this mailing list the right place to discuss about this type of details or is there a better place?

What I meant was that you should not couple the database extensions to your C library. Instead of having:

        struct conection *conn;
#ifdef LIXA
        if (lixa_is_active()) {
                conn = lixa_whatever();
        } else {
#endif
                conn = do_default();
        }

prefer something like:

        extern struct connection (*get_connection_override)(void);
        ...
        if (get_connection_override) {
                conn = get_connection_override();
        } else {
                conn = do_default();
        }

You can do this in different ways -- by having a PHP wide variable and generic function to retrieve and close connections that would be passed the type of resources an other parameters; you could have a different scheme for eachDB extension, etc. -- those details are relatively unimportant.

1. Is there any interest in "two phase commit" inside PHP community? Without a real interest, every effort would be useless.

It is very difficult to determine the future demand for something that does not exist yet. Microsoft introduced filesystem transactions in Windows Vista, and it's considering deprecating them. But given the prevalence of JTA in the Java world and the developments in PHP in the last years I would not be surprised if there was significant demand for this. And given the current tendency to use more specialized databases (see JCR client implementations), it may become more important in the future.

2. Is there anyone available to help me in implementing the interface between LIXA and database extensions in "the right way"? After some analysis I discovered some database extensions are really sophisticated and injecting a bug is simpler than adding a well implemented feature. I wouldn't break some working code.


I can review your patches and help you along the way.

Note that stable branches generally do not receive new features, so you should develop against the development branch (master). If it's your thing, you can fork PHP on github: https://github.com/php/php-src

--
Gustavo Lopes

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to