This avoids a synchronization issue when closing the connection - even though that code is single-threaded ATM.
Change-Id: I9a57ce72664ffce42239f6d1199195bfe72b216b
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);
}
@AfterClass
public static void closeDBLink() {
- if (l != null) {
- l.close();
- l = null;
+ synchronized (ConfiguredTest.class) {
+ if (l != null) {
+ l.close();
+ l = null;
+ }
}
}