Subject Re: [firebird-php] transaction problem
Author Leonardo Cosmai
Il Mon, 15 Nov 2004 20:10:57 -0000
"leonbadman" <leonardo.cosmai@...> ha scritto:


>
> $transaction = ibase_trans(IBASE_DEFAULT, $connection);
> $transaction1 = ibase_trans(IBASE_DEFAULT, $connection);
>
>
> $pstm = ibase_prepare($connection, "SELECT COUNT(*) AS N FROM T");
> $rs = ibase_execute($pstm);
> $r = ibase_fetch_object($rs);
> echo "BEFORE:" . $r->N . "<br>";
> ibase_free_query($pstm);
>

> ....


> BEFORE:0
> AFTER (CONN):2
> AFTER (TRAN):2
> AFTER (TRAN1):3
> AFTER COMMIT (CONN):5

very strange...try to swap the sequence:


> $pstm = ibase_prepare($connection, "SELECT COUNT(*) AS N FROM T");
> $rs = ibase_execute($pstm);
> $r = ibase_fetch_object($rs);
> echo "BEFORE:" . $r->N . "<br>";
> ibase_free_query($pstm);

> $transaction = ibase_trans(IBASE_DEFAULT, $connection);
> $transaction1 = ibase_trans(IBASE_DEFAULT, $connection);


now the result is:

BEFORE:0
AFTER (CONN):1
AFTER (TRAN):1
AFTER (TRAN1):3
AFTER COMMIT (CONN):1


Ciao, L.
(Linux User #332241)
-----------------------
afortune4u!

Regole di Goldenstern:
(1) Assumi sempre un avvocato ricco.
(2) Non comprare mai da un venditore ricco.