- Timestamp:
- 2018-11-07T20:44:34+13:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugouts/GreenstoneSQLPlugout.pm
r32580 r32582 38 38 use DBI; # the central package for this plugout 39 39 40 41 # This entire class is called only during import.pl 40 42 41 43 # TODO: SIGTERM rollback and disconnect? … … 69 71 'desc' => "{GreenstoneSQLPlug.process_mode.all}" } ]; 70 72 73 my $rollback_on_cancel_list = 74 [ { 'name' => "true", 75 'desc' => "{GreenstoneSQLPlug.rollback_on_cancel}" }, 76 { 'name' => "false", 77 'desc' => "{GreenstoneSQLPlug.rollbacl_on_cancel}" } ]; 78 71 79 # The following are the saveas.options: 72 80 my $arguments = [ … … 76 84 'list' => $process_mode_list, 77 85 'deft' => "all", 86 'reqd' => "no", 87 'hiddengli' => "no"}, 88 { 'name' => "rollback_on_cancel", 89 'desc' => "{GreenstoneSQLPlug.rollback_on_cancel}", 90 'type' => "enum", 91 'list' => $rollback_on_cancel_list, 92 'deft' => "true", # TODO Q: what's the better default? If "true", any memory concerns? 78 93 'reqd' => "no", 79 94 'hiddengli' => "no"}, … … 146 161 'collection_name' => $ENV{'GSDLCOLLECTION'}, 147 162 'verbosity' => $self->{'verbosity'} || 0 163 148 164 }; 149 165 150 166 my $gs_sql = new gssql($db_params); 167 168 # if autocommit is set, there's no rollback support 169 my $autocommit = ($self->{'rollback_on_cancel'} eq "false") ? 1 : 0; 151 170 152 171 # try connecting to the mysql db, die if that fails … … 156 175 'db_client_user' => $self->{'db_client_user'}, 157 176 'db_client_pwd' => $self->{'db_client_pwd'}, 158 'db_host' => $self->{'db_host'} 177 'db_host' => $self->{'db_host'}, 178 'autocommit' => $autocommit 159 179 }) 160 180 ) … … 164 184 die("Could not connect to db. Can't proceed.\n"); 165 185 } 186 187 #die("@@@@ TEST. Connected successfully. Testing gssql::destructor.\n"); # WORKS 166 188 167 189 my $db_name = $self->{'site_name'} || "greenstone2"; # one database per GS3 site, for GS2 the db is called greenstone2
Note:
See TracChangeset
for help on using the changeset viewer.