Re: Problems with DBI transaction handling - Mailing list pgsql-interfaces

From Nigel J. Andrews
Subject Re: Problems with DBI transaction handling
Date
Msg-id Pine.LNX.4.21.0302062334010.10564-100000@ponder.fairway2k.co.uk
Whole thread Raw
In response to Problems with DBI transaction handling  (Hans-Jürgen Schönig <hs@cybertec.at>)
List pgsql-interfaces
On Fri, 7 Feb 2003, Hans-Jürgen Schönig wrote:

> Hi ...
>
> I am using:
>
> DBI-1.21.tar.gz
> DBD-Pg-1.01.tar.gz

The versions I'v been using are DBI 1.30 an DBD::Pg 1.13

>
> my problem is that Perl complains about connections which are not closed
> properly and so forth but the main problem is that transactions don't
> seem to commit although the entire transaction seems to work fine. Maybe
> this has to do with SERIALIZABLE mode but it is hard to say. The only
> thing I am doing is a simple loop doing UPDATEs. I have been using DBI
> for a long time but this is the first time where transactions are used
> that heavily (normally we use Pg instead).

Gotcha. The issue I was having with transactions was messages (can't remember
if warnings or errors now) about active connections. What I was doing was some
queries were basic tests of existance and others I knew returned only one row
so I only read one row. Not fetching until the likes of fetchrow_arrayref
return undef leaves the connection in an active state. Perhaps you have a
similar situation. If so you need to fetch all the data queried _or_ use the
finish() method to signal you have finished with the query.

>
> Maybe I should upgrade to a newer version but it seems as if this does
> not help in my case. I have no idea.

Not sure, it seems pretty old going by version numbers but mine are from a perl
5.8 installation I have no idea what is with the perl 5.05 that was originally
installed.

>
> What we really need: A Perl module accessing LibEasy providing an
> interface to persistent database connections. I am using ApacheDBI at
> the moment (this seems to work well).

As I said before my experience wasn't with the mod_perl and persistent
connections and I don't know how those are controlled. I can well imagine I
will be going that route sometime though so all this is useful for me as
well.

> >     Hans
>
>
>
> Nigel J. Andrews wrote:
>
> >On Tue, 4 Feb 2003, Hans-Jürgen Schönig wrote:
> >
> >
> >
> >>Does anybody else have problems with DBI transaction handling? Since
> >>PostgreSQL 7.3 (most likely) the stuff seems to be broken. Errors occur
> >>even if autocommit is set properly and rollbacks are not performed the
> >>way it should be.
> >>
> >>Does anybody have similar problems? This is VERY annoying and should not
> >>happen.
> >>The problem is: There is no other interface around providing persistent
> >>connections with Perl/Apache.
> >>
> >>Maybe it is worth thinking about a Perl implementation of LibEasy with
> >>Apache persistent connections.
> >>
> >>
> >
> >Well I have wasted so much time recently, some of it spent trying to work out
> >what DBI was doing. However, that was my lack of knowledge, although I'm still
> >not convinced my tests don't now pass by luck. I'm also using a 7.2.3 server
> >not 7.3 yet and it's not using the mod_perl persistent connection stuff.
> >
> >So in short, I'm not surprised you're having problems but unfortunately I can't
> >say I experienced the same problem. Perhaps you could give a small test case
> >that shows the problem as I'm sure DBI must have been tested against 7.3.
> >
> >
> >
> >
>
>
>
>
>
>

--
Nigel J. Andrews



pgsql-interfaces by date:

Previous
From: "Nigel J. Andrews"
Date:
Subject: Re: Problems with DBI transaction handling
Next
From: Rudy Lippan
Date:
Subject: Re: Problems with DBI transaction handling