]> WPIA git - gigi.git/blobdiff - tests/club/wpia/gigi/testUtils/ConfiguredTest.java
chg: Make synchronization on the Database layer explicit
[gigi.git] / tests / club / wpia / gigi / testUtils / ConfiguredTest.java
index cdacf6922f0f4af08d51e5484f210211fa96b654..711007a047eafe94703507f2ddac532650e8a8eb 100644 (file)
@@ -93,7 +93,9 @@ public abstract class ConfiguredTest {
         if ( !DatabaseConnection.isInited()) {
             DatabaseConnection.init(testProps);
             try {
-                l = DatabaseConnection.newLink(false);
+                synchronized (ConfiguredTest.class) {
+                    l = DatabaseConnection.newLink(false);
+                }
             } catch (InterruptedException e) {
                 throw new Error(e);
             }
@@ -104,9 +106,11 @@ public abstract class ConfiguredTest {
 
     @AfterClass
     public static void closeDBLink() {
-        if (l != null) {
-            l.close();
-            l = null;
+        synchronized (ConfiguredTest.class) {
+            if (l != null) {
+                l.close();
+                l = null;
+            }
         }
     }