summaryrefslogtreecommitdiffstats
path: root/config-db/OpenSLX/MetaDB/DBI.pm
diff options
context:
space:
mode:
Diffstat (limited to 'config-db/OpenSLX/MetaDB/DBI.pm')
-rw-r--r--config-db/OpenSLX/MetaDB/DBI.pm42
1 files changed, 41 insertions, 1 deletions
diff --git a/config-db/OpenSLX/MetaDB/DBI.pm b/config-db/OpenSLX/MetaDB/DBI.pm
index 75d5a001..b7025e65 100644
--- a/config-db/OpenSLX/MetaDB/DBI.pm
+++ b/config-db/OpenSLX/MetaDB/DBI.pm
@@ -46,12 +46,33 @@ sub disconnect
}
sub quote
-{ # default implementation quotes any given values through the DBD-driver
+{ # default implementation quotes any given values through the DBI
my $self = shift;
return $self->{'dbh'}->quote(@_);
}
+sub start_transaction
+{ # default implementation passes on the request to the DBI
+ my $self = shift;
+
+ return $self->{'dbh'}->begin_work();
+}
+
+sub commit_transaction
+{ # default implementation passes on the request to the DBI
+ my $self = shift;
+
+ return $self->{'dbh'}->commit();
+}
+
+sub rollback_transaction
+{ # default implementation passes on the request to the DBI
+ my $self = shift;
+
+ return $self->{'dbh'}->rollback();
+}
+
################################################################################
### data access functions
################################################################################
@@ -159,6 +180,16 @@ sub fetchExportIDsOfVendorOS
return $self->_doSelect($sql, 'id');
}
+sub fetchGlobalInfo
+{
+ my $self = shift;
+ my $id = shift;
+
+ return if !length($id);
+ my $sql = "SELECT * FROM global_info WHERE id = ".$self->quote($id);
+ return $self->_doSelect($sql, 'value');
+}
+
sub fetchSystemByFilter
{
my $self = shift;
@@ -556,6 +587,15 @@ sub changeExport
return $self->_doUpdate('export', $exportIDs, $valRows);
}
+sub changeGlobalInfo
+{
+ my $self = shift;
+ my $id = shift;
+ my $value = shift;
+
+ return $self->_doUpdate('global_info', [$id], [{ 'value' => $value }] );
+}
+
sub addSystem
{
my $self = shift;