IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 24110


Ignore:
Timestamp:
May 7, 2009, 11:27:13 AM (17 years ago)
Author:
bills
Message:

enhance usage message, tweak error parameter error detection
set $conn_attrs{PrintError} = 0 becuase mysql cookbook says that
it can cause problems with transactions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataStoreServer/scripts/dsreg

    r23902 r24110  
    102102    }
    103103    if (($linkfiles or $copyfiles) and !$datapath and !$abspath) {
    104         $err .= "need to specify datapath with --link or --copy\n";
    105     }
    106     if ($linkfiles && (substr($datapath, 0, 1) ne "/")) {
     104        $err .= "need to specify datapath or abspath with --link and --copy\n";
     105    }
     106    if (!$abspath && $linkfiles && (substr($datapath, 0, 1) ne "/")) {
    107107        $err .= "datapath must begin with / when using --link\n";
    108108    }
     
    144144
    145145my $dsn = "DBI:mysql:host=$dbserver;database=$dbname";
    146 my %conn_attrs = (PrintError => 1, RaiseError => 1, AutoCommit => 0);
     146# mysql cookbook says 'PrintError can interfere with failure detection in some cases'
     147my %conn_attrs = (PrintError => 0, RaiseError => 1, AutoCommit => 0);
    147148
    148149my $dbh = DBI->connect_cached($dsn, $dbuser, $dbpass, \%conn_attrs)
     
    211212    if ($@) { # an error occured
    212213        print STDERR "transaction failed, rolling back error was:\n$@\n";
     214        # roll back within eval to prevent rollback failure from terminating the script
    213215        eval {$dbh->rollback();};
    214216        cleanup();
     
    476478    --copy      Copy files from datapath to Data Store
    477479    --datapath  path to source files for --copy or --link
     480    --abspath   path to source files is absoloute (--datapath not needed)
    478481    --ps0 - ps7 Optional product specific data
    479482    --rm        with --del remove the fileset directory from the Data Store
Note: See TracChangeset for help on using the changeset viewer.