Ignore:
Timestamp:
2018-11-09T19:13:32+13:00 (5 years ago)
Author:
ak19
Message:

Renamed gssql.pm to gsmysql.pm. Not subclassing the old gssql into gsmysql yet, as there's the complex issue of sighandlers, the static singleton method _get_connection_instance(), the singleton variable _db_instance and its use in the sighandlers and DESTROY, and how all of this can be impacted when making them part of an inheritance chain. Not sure of the best way to structure inheritance around these things. Even if rollback_on_cancel ends up unnecessary, the singleton method _get_connection_instance and singleton object _db_instance still impact decisions around inheritance.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugouts/GreenstoneSQLPlugout.pm

    r32591 r32592  
    3434use GreenstoneXMLPlugout;
    3535use docprint;
    36 use gssql;
     36use gsmysql;
    3737
    3838use DBI; # the central package for this plugout
     
    170170    };
    171171
    172     my $gs_sql = new gssql($db_params);
     172    my $gs_sql = new gsmysql($db_params);
    173173
    174174    # if autocommit is set, there's no rollback support
     
    192192    }
    193193
    194     #die("@@@@ TEST. Connected successfully. Testing gssql::destructor.\n"); # WORKS
     194    #die("@@@@ TEST. Connected successfully. Testing gsmysql::destructor.\n"); # WORKS
    195195   
    196196    my $db_name = $self->{'site'} || "greenstone2"; # one database per GS3 site, for GS2 the db is called greenstone2
     
    212212    # This is fatal for the plugout, let's terminate here after disconnecting again
    213213    # PrintError would already have displayed the warning message on load fail
    214     # And on die() perl will call gssql destroy which will ensure a disconnect() from db
     214    # And on die() perl will call gsmysql destroy which will ensure a disconnect() from db
    215215    #$gs_sql->force_disconnect_from_db(); # disconnect_from_db() will issue a warning on error
    216216    die("Could not use db $db_name and/or prepare its tables. Can't proceed.\n");
     
    237237
    238238    # Important to call finished():
    239     # it will disconnect from db if this is the last gssql instance,
     239    # it will disconnect from db if this is the last gsmysql instance,
    240240    # and it will commit to db before disconnecting if rollbback_on_cancel turned on
    241241    $self->{'gs_sql'}->finished();
Note: See TracChangeset for help on using the changeset viewer.