public void open( final String iUserName, final String iUserPassword, final Map<String, Object> iOptions) { addUser(); lock.acquireExclusiveLock(); connectionUserName = iUserName; connectionUserPassword = iUserPassword; connectionOptions = iOptions != null ? new HashMap<String, Object>(iOptions) : null; // CREATE A COPY TO AVOID USER MANIPULATION // POST OPEN try { openRemoteDatabase(); configuration = new OStorageConfiguration(this); configuration.load(); } catch (Exception e) { if (!OGlobalConfiguration.STORAGE_KEEP_OPEN.getValueAsBoolean()) close(); if (e instanceof RuntimeException) // PASS THROUGH throw (RuntimeException) e; else throw new OStorageException("Cannot open the remote storage: " + name, e); } finally { lock.releaseExclusiveLock(); } }
@BeforeClass public void before() { oldStorageOpen = OGlobalConfiguration.STORAGE_KEEP_OPEN.getValueAsBoolean(); OGlobalConfiguration.STORAGE_KEEP_OPEN.setValue(false); }