Changeset 32592 for main/trunk/greenstone2/perllib/gsmysql.pm
- Timestamp:
- 2018-11-09T19:13:32+13:00 (5 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/gsmysql.pm
r32591 r32592 1 1 ########################################################################### 2 2 # 3 # gs sql.pm -- DBI forSQL related utility functions used by3 # gsmysql.pm -- Uses DBI for MySQL related utility functions used by 4 4 # GreenstoneSQLPlugout and GreenstoneSQLPlugin too. 5 5 # A component of the Greenstone digital library software … … 25 25 ########################################################################### 26 26 27 package gs sql;27 package gsmysql; 28 28 29 29 use strict; … … 43 43 # TODO Q: If disconnect is automatically called when object destroyed, what does that mean 44 44 # for our file-global handle object, is disconnect only called at end of perl process? 45 # Does that mean we don't need to explicitly call disconnect in gs sql object's destroy during45 # Does that mean we don't need to explicitly call disconnect in gsmysql object's destroy during 46 46 # the GLOBAL destruction phase? 47 47 # https://perldoc.perl.org/perlobj.html#Destructors … … 345 345 } 346 346 347 # Will disconnect if this instance of gs sql holds the last reference to the db connection347 # Will disconnect if this instance of gsmysql holds the last reference to the db connection 348 348 # If disconnecting and autocommit is off, then this will commit before disconnecting 349 349 sub finished { … … 385 385 # NO: "When all the data has been fetched from a SELECT statement, the driver will automatically call finish for you. So you should not call it explicitly except when you know that you've not fetched all the data from a statement handle and the handle won't be destroyed soon." 386 386 387 print STDERR " GS SQL disconnecting from database\n" if $self->{'verbosity'};387 print STDERR " GSMySQL disconnecting from database\n" if $self->{'verbosity'}; 388 388 # Just go through the singleton db handle to disconnect 389 389 $_dbh_instance->disconnect or warn $_dbh_instance->errstr; 390 390 $_dbh_instance = undef; 391 391 } 392 # Number of gs sql objects that share a live connection is now 0, as the connection's dead393 # either because the last gs sql object finished() or because connection was killed (force)392 # Number of gsmysql objects that share a live connection is now 0, as the connection's dead 393 # either because the last gsmysql object finished() or because connection was killed (force) 394 394 $ref_count = 0; 395 395 }
Note:
See TracChangeset
for help on using the changeset viewer.