---
title: "PHP+Postgresql transaction problem"
type: "forum-thread"
url: "https://www.webforum.nu/amne/php/142091-php-postgresql-transaction-problem"
topic: "PHP"
topic_url: "https://www.webforum.nu/amne/php"
author: "niels"
published: "2006-02-06T17:22:39.000Z"
updated: "2006-02-06T17:22:39.000Z"
replies: 0
views: 230
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/php/142091-php-postgresql-transaction-problem"
---

# PHP+Postgresql transaction problem

## #1 — niels, 2006-02-06T17:22Z

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??

Permalänk: https://www.webforum.nu/p/142091

---

Tråden på webben: https://www.webforum.nu/amne/php/142091-php-postgresql-transaction-problem
