ID:               25282
 Updated by:       [EMAIL PROTECTED]
 Reported By:      nigel at e-easy dot com dot au
-Status:           Closed
+Status:           Bogus
 Bug Type:         InterBase related
 Operating System: Irrelevant
 PHP Version:      Irrelevant


Previous Comments:
------------------------------------------------------------------------

[2003-08-28 18:06:43] [EMAIL PROTECTED]

The constants are useless without a way of specifying a table name.
Therefore, this will not be changed. PHP5 will support table
reservation by means of SET TRANSACTION statements.

------------------------------------------------------------------------

[2003-08-28 17:38:07] nigel at e-easy dot com dot au

Handling Lock Conflicts is what I'm trying to do.
By stating that I want to reserve a table as shared write, I can then
update a single field much faster, as any transaction can write to the
table - even if it's been updated inside this transaction space.

...Or so I thought...

On the Firebird list, they're stating that the default mode is Shared
Write - not mentioned anywhere in the PHP source.

Ah, another undocumented behaviour.

Thanks for your time!

N.

------------------------------------------------------------------------

[2003-08-28 04:47:26] [EMAIL PROTECTED]

Passing the table reservation flags in this way will result in
absolutely nothing, because they require a table name as an extra
argument. You cannot just lock all tables for [shared|protected]
[read|write].

As PHP5 will contain support in ibase_trans() for multiple databases,
adding tablenames as arguments as well would clutter up the prototype
too much.

PHP5 _will_ allow you to execute SET TRANSACTION statements. Then you
can pass table reservation flags (with tablenames) anyway you like.

I seriously doubt, though, that unconditionally locking tables instead
of only when necessary would actually improve performance. As far as I
know, these parameters were introduced to handle lock conflicts.

------------------------------------------------------------------------

[2003-08-27 23:52:17] nigel at e-easy dot com dot au

The patch for interbase.c where we apply the mask for 
PHP_IBASE_PROTECTED should read: 
+                       tpb[tpb_len++] = isc_tpb_protected 
 
and NOT: 
+                       tpb[tpb_len++] = isc_tpb_shared 
 
....sorry...

------------------------------------------------------------------------

[2003-08-27 23:48:23] nigel at e-easy dot com dot au

Description:
------------
PHP's support for Interbase(Firebird) is missing two important 
features for transaction handling - Shared, and Protected. 
These two additions enable performance to surpass Oracle on 
updates under heavy load. 
 
The patch is as follows: 
--- interbase.c.orig    Thu Aug 28 11:39:22 2003 
+++ interbase.c Thu Aug 28 12:22:44 2003 
@@ -563,6 +563,8 @@ 
        
REGISTER_LONG_CONSTANT("IBASE_REC_NO_VERSION", 
PHP_IBASE_REC_NO_VERSION 
, CONST_PERSISTENT); 
        REGISTER_LONG_CONSTANT("IBASE_NOWAIT", 
PHP_IBASE_NOWAIT, CONST_PERSISTE 
NT); 
        REGISTER_LONG_CONSTANT("IBASE_WAIT", 
PHP_IBASE_WAIT, CONST_PERSISTENT); 
+       REGISTER_LONG_CONSTANT("IBASE_SHARED", 
PHP_IBASE_SHARED, CONST_PERSISTE 
NT); 
+       REGISTER_LONG_CONSTANT("IBASE_PROTECTED", 
PHP_IBASE_PROTECTED, CONST_PE 
RSISTENT); 
         
        return SUCCESS; 
 } 
@@ -1574,6 +1576,13 @@ 
                        tpb[tpb_len++] = isc_tpb_nowait; 
                } else { 
                        tpb[tpb_len++] = isc_tpb_wait;  /* default lock

resolut 
ion */ 
+               } 
+               /* Pre Allocation Modes */ 
+               if (trans_argl & PHP_IBASE_SHARED) { 
+                       tpb[tpb_len++] = isc_tpb_shared; 
+               } 
+               if (trans_argl & PHP_IBASE_PROTECTED) { 
+                       tpb[tpb_len++] = isc_tpb_shared; 
                } 
        } 
  
--- php_interbase.h.orig        Thu Aug 28 11:59:34 2003 
+++ php_interbase.h     Thu Aug 28 12:21:34 2003 
@@ -175,7 +175,9 @@ 
        PHP_IBASE_REC_VERSION           = 64, 
        PHP_IBASE_REC_NO_VERSION        = 128, 
        PHP_IBASE_NOWAIT                                = 256, 
-       PHP_IBASE_WAIT                          = 512 
+       PHP_IBASE_WAIT                          = 512, 
+       PHP_IBASE_SHARED                = 1024, 
+       PHP_IBASE_PROTECTED             = 2048 
 }; 
  
 #ifdef ZTS 
 



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=25282&edit=1

Reply via email to