- Timestamp:
- 2018-11-08T17:22:04+13:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugouts/GreenstoneSQLPlugout.pm
r32582 r32583 39 39 40 40 41 # This entire class is called only during import.pl 42 43 # TODO: SIGTERM rollback and disconnect? 44 # TODO Q: what about verbosity for debugging, instead of current situation of printing out upon debug set at the expense of writing to db 41 # + TODO: SIGTERM rollback and disconnect? 42 # + TODO Q: what about verbosity for debugging, instead of current situation of printing out upon debug set at the expense of writing to db 45 43 # TODO Q: introduced site_name param to plugins and plugouts. Did I do it right? And should they have hiddengli = "yes" 46 44 # Did I do the pass by ref in docprint's escape and unescape textref functions correctly, and how they're called here? … … 121 119 'args' => $arguments }; 122 120 121 ##### This entire class is called only during import.pl ##### 122 123 ##### Overridden methods ##### 124 123 125 sub new { 124 126 my ($class) = shift (@_); … … 205 207 # This is fatal for the plugout, let's terminate here after disconnecting again 206 208 # PrintError would already have displayed the warning message on load fail 207 $gs_sql->force_disconnect_from_db(); # disconnect_from_db() will issue a warning on error 209 # And on die() perl will call gssql destroy which will ensure a disconnect() from db 210 #$gs_sql->force_disconnect_from_db(); # disconnect_from_db() will issue a warning on error 208 211 die("Could not use db $db_name and/or prepare its tables. Can't proceed.\n"); 209 212 } … … 227 230 # do the superclass stuff first, as any sql db failures should not prevent superclass cleanup 228 231 $self->SUPER::end(@_); 229 230 $self->{'gs_sql'}->finished(); # will disconnect from db if last instance 232 233 # Important to call finished(): 234 # it will disconnect from db if this is the last gssql instance, 235 # and it will commit to db before disconnecting if rollbback_on_cancel turned on 236 $self->{'gs_sql'}->finished(); 231 237 delete $self->{'gs_sql'}; # key gs_sql no longer exists, not just the value being undef 232 238 } … … 295 301 296 302 297 # 3. post save out 298 #$self->SUPER::post_saveas(@_); 303 # 3. post save out 299 304 $self->SUPER::post_saveas($doc_obj, $doc_dir, $docxml_outhandler, $output_file); 300 305 … … 304 309 } 305 310 311 ##### New methods, not inherited ##### 306 312 307 313 # write meta and/or text PER DOC out to DB
Note:
See TracChangeset
for help on using the changeset viewer.