angeloulivieri has asked for the wisdom of the Perl Monks concerning the following question:
Hi all,
I have searched a lot but couldn't find an answer to this. I am using the construct
$dbh = DBI->connect($dsn, $user, $pass, { RaiseError => 1, AutoCommit +=> 0 }); #Here we open a locked access to the database my $select_handle; eval{ $dbh->do("BEGIN WORK"); $dbh->do("LOCK TABLE $table"); ###CODE $dbh->do("COMMIT WORK"); };
To access a Postgres db in a exclusive way. This construct works fine but each time it is used a Warning comes out
WARNING: there is already a transaction in progress
Someone knows how can I avoid it? It is little annoying this print in the log file of my program which accesses tens of times to the database. Thanks in advance
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to remove the warning: "there is already a transaction in progress" when using lock table
by runrig (Abbot) on Apr 13, 2016 at 20:39 UTC | |
Re: How to remove the warning: "there is already a transaction in progress" when using lock table
by Discipulus (Abbot) on Apr 13, 2016 at 20:42 UTC | |
by cavac (Priest) on Apr 14, 2016 at 06:11 UTC |
Back to
Seekers of Perl Wisdom