-Fix for circumstances where a single Table object lifetime spans the period before DB worker is initialized and after

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4136 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2009-09-15 15:33:33 +00:00
parent 64fd1fb97d
commit d02b8d9de8

View File

@ -217,7 +217,18 @@ sub handle_dbc_request {
} else {
return 0;
}
} elsif ($functionname eq 'getAllAttribs') {
} else {
unless (defined $opentables{$tablename}->{$autocommit}) {
#We are servicing a Table object that used to be
#non data-worker. Create a new DB worker side Table like the one
#that requests this
$opentables{$tablename}->{$autocommit} = xCAT::Table->new($tablename,-create=>0,-autocommit=>$autocommit);
unless ($opentables{$tablename}->{$autocommit}) {
return undef;
}
}
}
if ($functionname eq 'getAllAttribs') {
return $opentables{$tablename}->{$autocommit}->getAllAttribs(@args);
} elsif ($functionname eq 'getAttribs') {
return $opentables{$tablename}->{$autocommit}->getAttribs(@args);