From: | Francois Suter <dba(at)paragraf(dot)ch> |
---|---|
To: | Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp>, pgsql-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: PostgreSQL/PHP: transactions: how-to abstract out? |
Date: | 2003-01-10 08:49:08 |
Message-ID: | BA444794.28C4%dba@paragraf.ch |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
> Can someone recommend a way to abstract out my DB layer while still
> being able to use transactions? (persistent connections are not an
> option since there are too many inherent dangers).
I use a class. The connection handle is stored as a member variable and the
function that executes a query is a method, so that every query is processed
via the same connection.
To avoid instanciating several objects for different querys and having
multiple connection to the DB, my class is able to store result handles in
an array using names and can switch back and forth between different result
handles as needed.
You might want to take a look at PEAR::DB too if only for inspiration.
Hope this helps.
Cheers.
--------
Francois
Home page: http://www.monpetitcoin.com/
"We waste our time spending money we don't have to buy things we don't need
to impress people we don't like"
From | Date | Subject | |
---|---|---|---|
Next Message | dev | 2003-01-10 09:54:34 | Re: Stable function Repeatedly Called |
Previous Message | Lincoln Yeoh | 2003-01-10 08:19:46 | Re: PostgreSQL/PHP: transactions: how-to abstract |