Re: Problems with DBI transaction handling

Поиск
Список
Период
Сортировка
От Rudy Lippan
Тема Re: Problems with DBI transaction handling
Дата
Msg-id Pine.LNX.4.44.0302061940350.7672-100000@elfride.ineffable.net
обсуждение исходный текст
Ответ на Problems with DBI transaction handling  (Hans-Jürgen Schönig <hs@cybertec.at>)
Список 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



В списке pgsql-interfaces по дате отправления:

Предыдущее
От: "Nigel J. Andrews"
Дата:
Сообщение: Re: Problems with DBI transaction handling
Следующее
От: Hans-Jürgen Schönig
Дата:
Сообщение: Re: Problems with DBI transaction handling