public void release(final DB iDatabase) {
    final String dbPooledName =
        iDatabase instanceof ODatabaseComplex
            ? ((ODatabaseComplex<?>) iDatabase).getUser().getName() + "@" + iDatabase.getURL()
            : iDatabase.getURL();

    synchronized (pools) {
      final OResourcePool<String, DB> pool = pools.get(dbPooledName);
      if (pool == null)
        throw new OLockException(
            "Cannot release a database URL not acquired before. URL: " + iDatabase.getName());

      pool.returnResource(iDatabase);
    }
  }
예제 #2
0
 public String getURL() {
   return underlying.getURL();
 }