webForumDet fria alternativet

PHP+Postgresql transaction problem

0 svar · 228 visningar · startad av niels

nielsMedlem sedan juli 2000215 inlägg
#1

Har följande problem: (skriver på engelska eftersom jag har postat på annat forum med... copy&paste grymmaste verktyget!)

I'm having big trouble with a postgre transaction problem.

I'm using phplib Database class for wrapping up a connection to the database.

Consider the following scripts:

$db = new Database();

$db->query("BEGIN");

..
calls some other class that performs database manipulation that should be included in the transaction by creating a separate Database object and thus another connection to the database.
..

exit;
$db->query("COMMIT");

even thought the COMMIT-statement is never reached the database manipulations are still commited!?

How can I fix this without having to pass around one database connection??

Genererad på 390 ms · cache AV · v20260730165559-full.f96bc7eb