Re: Problems with DBI transaction handling

From: Rudy Lippan <rlippan(at)remotelinux(dot)com>
To: Hans-Jürgen Schönig <hs(at)cybertec(dot)at>
Cc: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>, <pgsql-interfaces(at)postgresql(dot)org>, <rlippan(at)remotelinux(dot)com>
Subject: Re: Problems with DBI transaction handling
Date: 2003-02-07 01:03:14
Message-ID: Pine.LNX.4.44.0302061940350.7672-100000@elfride.ineffable.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

On Fri, 7 Feb 2003, Hans-Jürgen Schönig wrote:

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

They are a bit old, but no major bug fixen since then (on the DBD::Pg
side, I do not remember about DBI offhand)

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

That could be your problem. When you close a connection, or perl closes
the connection for you, the driver will automatically issue a rollback
because it will assume that since you have not called commit, you did not
want the data saved to the database (think along the lines of an untrapped
die that causes perl to terminate your program -- do you want the data
commited?)

> this has to do with SERIALIZABLE mode but it is hard to say. The only

Shouldn't.

> 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).
>

Do you have sample code that shows the problem?

> Maybe I should upgrade to a newer version but it seems as if this does
> not help in my case. I have no idea.
>
> 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).

LibEasy? Have a URL? Google is not giving me much.

Interesting. Apache::DBI should overload the disconnect method so that
you never get disconnected from the databse; and hence, you should never
see bit about connections not being closed properly? Do you, have
a die, or an exit() that is causing your process to terminate before you
call commit()?

You also might want to call 'DBI->trace(<trace level 1..9>);' so that you
can see exactly what is going on.

-r

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message mehrzad soltani 2003-02-08 04:45:37 How can i make a dll project in KDE Developer?
Previous Message Nigel J. Andrews 2003-02-06 23:44:27 Re: Problems with DBI transaction handling