my $result = $self->{db_connection}->do($query);
if (!$result) {
- main::print_msg("Could not execute database query", ERROR);
+ main::print_msg("Could not execute database query: $DBI::errstr", ERROR);
return 0;
}
$main::statistics{'database_queries'}++;
my $st = $self->{db_connection}->prepare($query);
if (!$st->execute(@param)) {
- main::print_msg("Could not execute database query", ERROR);
+ main::print_msg("Could not execute database query: $DBI::errstr", ERROR);
return undef;
}
$main::statistics{'database_queries'}++;
}
+# begin()
+#
+# start a stransaction
+#
+# parameter:
+# - self
+# return:
+# - status of the command
+sub begin {
+ my $self = shift;
+
+ return $self->{db_connection}->begin_work();
+}
+
+
+# commit()
+#
+# commit a stransaction
+#
+# parameter:
+# - self
+# return:
+# - status of the command
+sub commit {
+ my $self = shift;
+
+ return $self->{db_connection}->commit();
+}
+
+
+# rollback()
+#
+# rollback a stransaction
+#
+# parameter:
+# - self
+# return:
+# - status of the command
+sub rollback {
+ my $self = shift;
+
+ return $self->{db_connection}->rollback();
+}
+
+
# DESTROY()
#
# destructor