From b2b42e28449fccddcbf7c64b1986b2854048f32b Mon Sep 17 00:00:00 2001 From: linggao Date: Wed, 28 Oct 2009 20:03:35 +0000 Subject: [PATCH] removed unnecessay table.commit calls for def command git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4461 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/DBobjUtils.pm | 4 ++-- xCAT-server/lib/xcat/plugins/DBobjectdefs.pm | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/perl-xCAT/xCAT/DBobjUtils.pm b/perl-xCAT/xCAT/DBobjUtils.pm index 2c8a8212a..3e9fdafee 100644 --- a/perl-xCAT/xCAT/DBobjUtils.pm +++ b/perl-xCAT/xCAT/DBobjUtils.pm @@ -224,7 +224,7 @@ sub getobjattrs } } } - $thistable->commit; + #$thistable->commit; } } } @@ -614,7 +614,7 @@ sub getDBtable @{$::TableHash{$table}} = @rows; - $thistable->commit; + #$thistable->commit; } # end if not cached diff --git a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm index e0481855d..fdf70604c 100644 --- a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm @@ -1155,6 +1155,7 @@ sub defmk xCAT::Table->new('nodelist', -create => 1, -autocommit => 0); my $newgroups; + my $changed=0; foreach my $n (@memberlist) { if ($::verbose) @@ -1192,11 +1193,13 @@ sub defmk if ($newgroups) { $tab->setNodeAttribs($n, {groups => $newgroups}); + $changed=1; } } - - $tab->commit; + if ($changed) { + $tab->commit; + } }