IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13245


Ignore:
Timestamp:
May 4, 2007, 11:20:43 AM (19 years ago)
Author:
jhoblitt
Message:

change getmountedvol() to set it's own transaction level to attempt to avoid hanging when the mounted table is modified while it's running

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm

    r13226 r13245  
    11# Copyright (c) 2004  Joshua Hoblitt
    22#
    3 # $Id: SQL.pm,v 1.38 2007-05-04 03:09:16 jhoblitt Exp $
     3# $Id: SQL.pm,v 1.39 2007-05-04 21:20:43 jhoblitt Exp $
    44
    55package Nebulous::Server::SQL;
     
    394394    DECLARE allocatevar BOOLEAN;
    395395    DECLARE availablevar BOOLEAN;
     396    DECLARE trans_level VARCHAR(255);
    396397    DECLARE cur1 CURSOR FOR SELECT vol_id, name, path, allocate, available FROM volume;
    397398    DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = TRUE;
     399
     400    -- store the current transaction level
     401    SELECT @@session.tx_isolation INTO trans_level;
     402
     403    -- set trans level
     404    SET @@session.tx_isolation = 'REPEATABLE-READ';
    398405
    399406    -- create a temp table to hold the merged results of the volume & mount
     
    436443   
    437444    CLOSE cur1;
     445
     446    -- restore the original transaction level
     447    SET @@session.tx_isolation = trans_level;
    438448END
  • trunk/Nebulous/lib/Nebulous/Server/SQL.pm

    r13226 r13245  
    11# Copyright (c) 2004  Joshua Hoblitt
    22#
    3 # $Id: SQL.pm,v 1.38 2007-05-04 03:09:16 jhoblitt Exp $
     3# $Id: SQL.pm,v 1.39 2007-05-04 21:20:43 jhoblitt Exp $
    44
    55package Nebulous::Server::SQL;
     
    394394    DECLARE allocatevar BOOLEAN;
    395395    DECLARE availablevar BOOLEAN;
     396    DECLARE trans_level VARCHAR(255);
    396397    DECLARE cur1 CURSOR FOR SELECT vol_id, name, path, allocate, available FROM volume;
    397398    DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = TRUE;
     399
     400    -- store the current transaction level
     401    SELECT @@session.tx_isolation INTO trans_level;
     402
     403    -- set trans level
     404    SET @@session.tx_isolation = 'REPEATABLE-READ';
    398405
    399406    -- create a temp table to hold the merged results of the volume & mount
     
    436443   
    437444    CLOSE cur1;
     445
     446    -- restore the original transaction level
     447    SET @@session.tx_isolation = trans_level;
    438448END
Note: See TracChangeset for help on using the changeset viewer.