[Bio] / FigKernelPackages / FIG.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/FIG.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.452, Wed Mar 29 19:40:35 2006 UTC revision 1.453, Wed Mar 29 20:41:33 2006 UTC
# Line 19  Line 19 
19    
20  use strict;  use strict;
21    
22    use FIG_Config;
23    
24    #
25    # See if we need to use fcntl-based file locking. If so, import
26    # the package and override the global definition of flock.
27    # This is in place at least initially for the GPFS-based install on
28    # the NMPDR cluster.
29    #
30    
31    use FileLocking;
32    
33  use Fcntl qw/:flock/;  # import LOCK_* constants  use Fcntl qw/:flock/;  # import LOCK_* constants
34    
35  use POSIX;  use POSIX;
# Line 34  Line 45 
45  use Sim;  use Sim;
46  use Annotation;  use Annotation;
47  use Blast;  use Blast;
 use FIG_Config;  
48  use FullLocation;  use FullLocation;
49  use tree_utilities;  use tree_utilities;
50  use Subsystem;  use Subsystem;
# Line 254  Line 264 
264      Trace("Connecting to the database.") if T(2);      Trace("Connecting to the database.") if T(2);
265      # Connect to the database, then return ourselves.      # Connect to the database, then return ourselves.
266      my $rdbH = new DBrtns;      my $rdbH = new DBrtns;
267      bless {  
268        my $self = {
269          _dbf  => $rdbH,          _dbf  => $rdbH,
270      }, $class;      };
271    
272        #
273        # If we have a readonly-database defined in the config,
274        # create a handle for that as well.
275        #
276    
277        if (defined($FIG_Config::readonly_dbhost))
278        {
279            my $ro = new DBrtns($FIG_Config::dbms, $FIG_Config::readonly_db, $FIG_Config::readonly_dbuser,
280                                $FIG_Config::readonly_dbpass, $FIG_Config::readonly_dbport, $FIG_Config::readonly_dbhost,
281                                $FIG_Config::readonly_dbsock);
282            $self->{_ro_dbf} = $ro;
283    
284            #
285            # Oh ick. All of the queries made go through the one dbf that a FIG holds. We want
286            # to redirect the select queries through this readonly object. We'll need
287            # to tell the main handle about the readonly one, and let it decide.
288            #
289    
290            $rdbH->set_readonly_handle($ro);
291        }
292    
293        return bless $self, $class;
294  }  }
295    
296  =head3 db_handle  =head3 db_handle

Legend:
Removed from v.1.452  
changed lines
  Added in v.1.453

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3