- Timestamp:
- 2018-11-07T20:44:34+13:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/GreenstoneSQLPlugin.pm
r32580 r32582 137 137 'desc' => "{GreenstoneSQLPlug.process_mode.all}" } ]; 138 138 139 my $rollback_on_cancel_list = 140 [ { 'name' => "true", 141 'desc' => "{GreenstoneSQLPlug.rollback_on_cancel}" }, 142 { 'name' => "false", 143 'desc' => "{GreenstoneSQLPlug.rollbacl_on_cancel}" } ]; 144 139 145 my $arguments = 140 146 [ { 'name' => "process_exp", … … 149 155 'deft' => "all", 150 156 'reqd' => "no"}, 157 { 'name' => "rollback_on_cancel", 158 'desc' => "{GreenstoneSQLPlug.rollback_on_cancel}", 159 'type' => "enum", 160 'list' => $rollback_on_cancel_list, 161 'deft' => "true", # TODO Q: what's the better default? If "true", any memory concerns? 162 'reqd' => "no", 163 'hiddengli' => "no"}, 151 164 { 'name' => "db_driver", 152 165 'desc' => "{GreenstoneSQLPlug.db_driver}", … … 204 217 } 205 218 219 ###### Called during import.pl 220 206 221 # This is called once if removeold is set with import.pl. Most plugins will do 207 222 # nothing but if a plugin does any stuff outside of creating doc obj, then … … 230 245 $gs_sql->ensure_fulltxt_table_exists(); 231 246 } 232 } 233 234 # This is called per document for docs that have been deleted from the 247 248 # UNNECESSARY 249 # The removeold related DB transaction (deleting collection tables) is complete 250 # Don't let GS SQL PlugIN interfere with GS SQL PlugOUT's database transactions 251 # during import.pl hereafter. Finish up. 252 #$gs_sql->do_commit_if_on(); 253 } 254 255 # This is called during import.pl per document for docs that have been deleted from the 235 256 # collection. Most plugins will do nothing 236 257 # but if a plugin does any stuff outside of creating doc obj, then it may need … … 273 294 } 274 295 296 #### Called during buildcol 275 297 276 298 sub xml_start_tag { … … 395 417 } 396 418 419 #### Called during buildcol and import 397 420 398 421 # GS SQL Plugin::init() (and deinit()) is called by import.pl and also by buildcol.pl … … 429 452 'verbosity' => $self->{'verbosity'} || 0 430 453 }); 454 455 # if autocommit is set, there's no rollback support 456 my $autocommit = ($self->{'rollback_on_cancel'} eq "false") ? 1 : 0; 431 457 432 458 # try connecting to the mysql db, die if that fails … … 435 461 'db_client_user' => $self->{'db_client_user'}, 436 462 'db_client_pwd' => $self->{'db_client_pwd'}, 437 'db_host' => $self->{'db_host'} 463 'db_host' => $self->{'db_host'}, 464 'autocommit' => $autocommit 438 465 }) 439 466 )
Note:
See TracChangeset
for help on using the changeset viewer.