diff options
author | Oliver Tappe | 2008-06-03 00:30:19 +0200 |
---|---|---|
committer | Oliver Tappe | 2008-06-03 00:30:19 +0200 |
commit | 9bdcb088ebddb422cd8e9a27e688e9718cf50013 (patch) | |
tree | b739b9ea762bc0aade42bd52f4d47db9b20ab9da /config-db/OpenSLX/MetaDB/DBI.pm | |
parent | * separated synchronization of attributes from removal of stale references, (diff) | |
download | core-9bdcb088ebddb422cd8e9a27e688e9718cf50013.tar.gz core-9bdcb088ebddb422cd8e9a27e688e9718cf50013.tar.xz core-9bdcb088ebddb422cd8e9a27e688e9718cf50013.zip |
Implemented a better algorithm for keeping the plugins and the references
to them (and their attributes) in the DB in sync:
* The DB now keeps a hash-value for the list of known plugins and their
attributes and checks this value against the current one on every connect.
If the values do not match, the DB is brought up-to-date automatically
(i.e. the attributes are synchronized with the systems, clients and groups).
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1837 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'config-db/OpenSLX/MetaDB/DBI.pm')
-rw-r--r-- | config-db/OpenSLX/MetaDB/DBI.pm | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/config-db/OpenSLX/MetaDB/DBI.pm b/config-db/OpenSLX/MetaDB/DBI.pm index 7acb861f..c4606f0c 100644 --- a/config-db/OpenSLX/MetaDB/DBI.pm +++ b/config-db/OpenSLX/MetaDB/DBI.pm @@ -1273,6 +1273,29 @@ sub schemaSetDBVersion return 1; } +sub schemaFetchPluginInfoHashVal +{ + my $self = shift; + + my $row + = $self->{dbh}->selectrow_hashref('SELECT plugin_info_hash FROM meta'); + + return $row->{plugin_info_hash}; +} + +sub schemaSetPluginInfoHashVal +{ + my $self = shift; + my $pluginInfoHashVal = shift; + + $self->{dbh}->do("UPDATE meta SET plugin_info_hash = '$pluginInfoHashVal'") + or croak _tr( + 'Unable to set plugin-info-hash-value to %s!', $pluginInfoHashVal + ); + + return 1; +} + sub schemaConvertTypeDescrToNative { # a default implementation, many DBs need to override... my $self = shift; |