[Bio] / Sprout / ERDB.pm Repository:
ViewVC logotype

Diff of /Sprout/ERDB.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9, Thu Jun 16 19:08:59 2005 UTC revision 1.10, Wed Jun 22 21:29:28 2005 UTC
# Line 1283  Line 1283 
1283          # Create the statistical return object.          # Create the statistical return object.
1284          my $retVal = _GetLoadStats();          my $retVal = _GetLoadStats();
1285          # Trace the fact of the load.          # Trace the fact of the load.
1286          Trace("Loading table $relationName from $fileName") if T(1);      Trace("Loading table $relationName from $fileName") if T(2);
1287          # Get the database handle.          # Get the database handle.
1288          my $dbh = $self->{_dbh};          my $dbh = $self->{_dbh};
1289          # Get the relation data.          # Get the relation data.
1290          my $relation = $self->_FindRelation($relationName);          my $relation = $self->_FindRelation($relationName);
1291          # Check the truncation flag.          # Check the truncation flag.
1292          if ($truncateFlag) {          if ($truncateFlag) {
1293                  Trace("Creating table $relationName") if T(1);          Trace("Creating table $relationName") if T(2);
1294                  # Re-create the table without its index.                  # Re-create the table without its index.
1295                  $self->CreateTable($relationName, 0);                  $self->CreateTable($relationName, 0);
1296            # If this is a pre-index DBMS, create the index here.
1297            if ($dbh->{_preIndex}) {
1298                eval {
1299                    $self->CreateIndex($relationName);
1300                };
1301                if ($@) {
1302                    $retVal->AddMessage($@);
1303                }
1304            }
1305          }          }
1306          # Determine whether or not this is a primary relation. Primary relations have an extra          # Determine whether or not this is a primary relation. Primary relations have an extra
1307          # field indicating whether or not a given object is new or was loaded from the flat files.          # field indicating whether or not a given object is new or was loaded from the flat files.
# Line 1348  Line 1357 
1357          # Close the files.          # Close the files.
1358          close TABLEIN;          close TABLEIN;
1359          close TABLEOUT;          close TABLEOUT;
1360      Trace("Temporary file $tempName created.") if T(4);      Trace("Temporary file $tempName created.") if T(2);
1361      # Load the table.      # Load the table.
1362          my $rv;          my $rv;
1363          eval {          eval {
# Line 1360  Line 1369 
1369                  Trace("Table load failed for $relationName.") if T(1);                  Trace("Table load failed for $relationName.") if T(1);
1370          } else {          } else {
1371                  # Here we successfully loaded the table. Trace the number of records loaded.                  # Here we successfully loaded the table. Trace the number of records loaded.
1372                  Trace("$retVal->{records} records read for $relationName.") if T(1);          Trace("$retVal->{records} records read for $relationName.") if T(2);
1373                  # If we're rebuilding, we need to create the table indexes.                  # If we're rebuilding, we need to create the table indexes.
1374                  if ($truncateFlag) {          if ($truncateFlag && ! $dbh->{_preIndex}) {
1375                          eval {                          eval {
1376                                  $self->CreateIndex($relationName);                                  $self->CreateIndex($relationName);
1377                          };                          };

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3