F
Filippo
hi,
my application is designed this way:
open a database connection at beginning
my $productionDatabase = DBI->connect(
"DBIgPP:dbname=$DATABASE_NAME;host=$DATABASE_SERVER;port=5432",
"postgres",
"postgres",
{
RaiseError => 1}
) or die (
"failed onnection failed: $DBI::errstr"
);
then keep open the connection and query database when needeed
my $sth = $dbh->prepare($sqlQuery);
$sth->execute;
my $result = $sth->fetchrow_arrayref;
I want that any database query fails (prepare, execute, fetchrow, do
etc) cause my application to die in case I don't want to manage the
error. As second step I want to cactch some errors in order to recover
from exception (ask the user to check the network connection and retry
the query...).
How can I do?
Thanks,
Filippo
my application is designed this way:
open a database connection at beginning
my $productionDatabase = DBI->connect(
"DBIgPP:dbname=$DATABASE_NAME;host=$DATABASE_SERVER;port=5432",
"postgres",
"postgres",
{
RaiseError => 1}
) or die (
"failed onnection failed: $DBI::errstr"
);
then keep open the connection and query database when needeed
my $sth = $dbh->prepare($sqlQuery);
$sth->execute;
my $result = $sth->fetchrow_arrayref;
I want that any database query fails (prepare, execute, fetchrow, do
etc) cause my application to die in case I don't want to manage the
error. As second step I want to cactch some errors in order to recover
from exception (ask the user to check the network connection and retry
the query...).
How can I do?
Thanks,
Filippo