LISTSERV mailing list manager LISTSERV 16.5

Help for HPS-SVN Archives


HPS-SVN Archives

HPS-SVN Archives


HPS-SVN@LISTSERV.SLAC.STANFORD.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

HPS-SVN Home

HPS-SVN Home

HPS-SVN  January 2015

HPS-SVN January 2015

Subject:

r1854 - /java/trunk/conditions/src/main/java/org/hps/conditions/database/DatabaseConditionsManager.java

From:

[log in to unmask]

Reply-To:

Notification of commits to the hps svn repository <[log in to unmask]>

Date:

Sun, 4 Jan 2015 03:07:42 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (94 lines)

Author: [log in to unmask]
Date: Sat Jan  3 19:07:37 2015
New Revision: 1854

Log:
Add default 5 second login timeout and configurable loginTimeout value from XML config.

Modified:
    java/trunk/conditions/src/main/java/org/hps/conditions/database/DatabaseConditionsManager.java

Modified: java/trunk/conditions/src/main/java/org/hps/conditions/database/DatabaseConditionsManager.java
 =============================================================================
--- java/trunk/conditions/src/main/java/org/hps/conditions/database/DatabaseConditionsManager.java	(original)
+++ java/trunk/conditions/src/main/java/org/hps/conditions/database/DatabaseConditionsManager.java	Sat Jan  3 19:07:37 2015
@@ -8,6 +8,7 @@
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.sql.Connection;
+import java.sql.DriverManager;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
@@ -61,9 +62,13 @@
 
     protected static Logger logger = LogUtil.create(DatabaseConditionsManager.class);
 
+    // Registry of conditions converters.
     protected ConverterRegistry converters = ConverterRegistry.create();
+    
+    // Registry of table meta data.
     protected TableRegistry tableRegistry = TableRegistry.create();
     
+    // Connection configuration.
     protected static final String CONNECTION_PROPERTY = "org.hps.conditions.connection.file";
     protected File connectionPropertiesFile;
     protected ConnectionParameters connectionParameters;
@@ -71,10 +76,12 @@
     protected boolean isConnected = false;
     protected boolean loggedConnectionParameters = false;
     
+    // Default configuration resources.
     protected static final String DEFAULT_CONFIG = "/org/hps/conditions/config/conditions_database_prod.xml";
     protected static final String TEST_RUN_CONFIG = "/org/hps/conditions/config/conditions_database_testrun_2012.xml";
     protected static final String ENGRUN_CONFIG = "/org/hps/conditions/config/conditions_database_engrun.xml";
     
+    // Max run number for the Test Run.
     protected static final int TEST_RUN_MAX_RUN = 1365;
     
     // The default Test Run detector.
@@ -83,6 +90,7 @@
     // The default Engineering Run detector.
     private static final String DEFAULT_ENG_RUN_DETECTOR = "HPS-Proposal2014-v8-6pt6";
     
+    // Detector setup.
     protected String detectorName;
     protected String ecalName = "Ecal";
     protected String svtName = "Tracker";
@@ -91,10 +99,10 @@
     protected EcalDetectorSetup ecalSetup = new EcalDetectorSetup(ecalName);
     protected SvtDetectorSetup svtSetup = new SvtDetectorSetup(svtName);
     
-
-        
+    // Active conditions tag.
     protected String tag = null;
 
+    // State of manager.
     protected boolean isInitialized = false;
     protected boolean isFrozen = false;
     protected boolean isConfigured = false;
@@ -106,6 +114,11 @@
     protected boolean closeConnectionAfterInitialize = true;
     protected boolean cacheAllConditions = false;
     protected boolean isTestRun = false;
+    
+    // Default login timeout of 5 seconds.
+    static {
+        DriverManager.setLoginTimeout(5);
+    }
     
     /**
      * Class constructor.
@@ -924,5 +937,10 @@
         if (element != null) {
             closeConnectionAfterInitialize = Boolean.parseBoolean(element.getText());
         }
+        
+        element = node.getChild("loginTimeout");
+        if (element != null) {
+            DriverManager.setLoginTimeout(Integer.parseInt(element.getText()));
+        }
     }
 }

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

November 2017
August 2017
July 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013

ATOM RSS1 RSS2



LISTSERV.SLAC.STANFORD.EDU

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager

Privacy Notice, Security Notice and Terms of Use