added a check to the open function to prevent losing a reference to an open database connection

Former-commit-id: 62e8386dce392d8c7fbc58febc4f5d4bc35e84f0
This commit is contained in:
Jeremy Long
2014-11-25 05:55:59 -05:00
parent ab4b19dbab
commit 96383ef985

View File

@@ -87,8 +87,10 @@ public class CveDB {
* @throws DatabaseException thrown if there is an error opening the database connection * @throws DatabaseException thrown if there is an error opening the database connection
*/ */
public final void open() throws DatabaseException { public final void open() throws DatabaseException {
if (!isOpen()) {
conn = ConnectionFactory.getConnection(); conn = ConnectionFactory.getConnection();
} }
}
/** /**
* Closes the DB4O database. Close should be called on this object when it is done being used. * Closes the DB4O database. Close should be called on this object when it is done being used.