/** * Called by the ShutdownHook on shutdown. */ public synchronized void shutdown() { LOG.info("Shutting down open ObjectStoreInterMineImpl with sequence = " + sequenceNumber + " and Database " + getDatabase().getURL()); try { close(); } catch (ObjectStoreException e) { LOG.warn("Exception caught while shutting down ObjectStoreInterMineImpl: " + e); } }
/** * Finalise this object. */ protected synchronized void doFinalise() { LOG.error("Garbage collecting ObjectStoreInterMineImpl with sequence = " + sequenceNumber + " and Database " + getDatabase().getURL()); try { close(); } catch (ObjectStoreException e) { LOG.error("Exception while garbage-collecting ObjectStoreInterMineImpl: " + e); } }
/** * Finalise this object. */ protected synchronized void doFinalise() { LOG.error("Garbage collecting ObjectStoreInterMineImpl with sequence = " + sequenceNumber + " and Database " + getDatabase().getURL()); try { close(); } catch (ObjectStoreException e) { LOG.error("Exception while garbage-collecting ObjectStoreInterMineImpl: " + e); } }
/** * Called by the ShutdownHook on shutdown. */ public synchronized void shutdown() { LOG.info("Shutting down open ObjectStoreInterMineImpl with sequence = " + sequenceNumber + " and Database " + getDatabase().getURL()); try { close(); } catch (ObjectStoreException e) { LOG.warn("Exception caught while shutting down ObjectStoreInterMineImpl: " + e); } }
/** * Overrides Object.finalize - release the connection back to the objectstore. */ @Override protected synchronized void doFinalise() { if (conn != null) { LOG.error("Garbage collecting open ObjectStoreWriterInterMineImpl with sequence = " + sequenceNumber + " and Database " + os.getDatabase().getURL() + ", createSituation: " + createSituation); try { close(); } catch (ObjectStoreException e) { LOG.error("Exception while garbage-collecting ObjectStoreWriterInterMineImpl: " + e); } } }
/** * Called by the StatsShutdownHook on shutdown */ @Override public synchronized void shutdown() { if (conn != null) { LOG.error("Shutting down open ObjectStoreWriterInterMineImpl with sequence = " + sequenceNumber + " and Database " + os.getDatabase().getURL() + ", createSituation = " + createSituation); try { close(); } catch (ObjectStoreException e) { LOG.error("Exception caught while shutting down ObjectStoreWriterInterMineImpl: " + e); } } }
/** * Called by the StatsShutdownHook on shutdown */ @Override public synchronized void shutdown() { if (conn != null) { LOG.error("Shutting down open ObjectStoreWriterInterMineImpl with sequence = " + sequenceNumber + " and Database " + os.getDatabase().getURL() + ", createSituation = " + createSituation); try { close(); } catch (ObjectStoreException e) { LOG.error("Exception caught while shutting down ObjectStoreWriterInterMineImpl: " + e); } } }
/** * Overrides Object.finalize - release the connection back to the objectstore. */ @Override protected synchronized void doFinalise() { if (conn != null) { LOG.error("Garbage collecting open ObjectStoreWriterInterMineImpl with sequence = " + sequenceNumber + " and Database " + os.getDatabase().getURL() + ", createSituation: " + createSituation); try { close(); } catch (ObjectStoreException e) { LOG.error("Exception while garbage-collecting ObjectStoreWriterInterMineImpl: " + e); } } }
/** * {@inheritDoc} */ @Override public void finalize() throws Throwable { super.finalize(); if (datasource instanceof com.zaxxer.hikari.HikariDataSource) { LOG.info("Finalise - Closing datasource for Database " + getURL() + "(" + toString() + ") with ClassLoader " + getClass().getClassLoader()); ((com.zaxxer.hikari.HikariDataSource) datasource).close(); } else if (datasource instanceof org.postgresql.ds.PGPoolingDataSource) { LOG.info("Finalise - Closing datasource for Database " + getURL() + "(" + toString() + ") with ClassLoader " + getClass().getClassLoader()); ((org.postgresql.ds.PGPoolingDataSource) datasource).close(); } else if (datasource instanceof org.postgresql.jdbc2.optional.PoolingDataSource) { LOG.info("Finalise - Closing datasource for Database " + getURL() + "(" + toString() + ") with ClassLoader " + getClass().getClassLoader()); ((org.postgresql.jdbc2.optional.PoolingDataSource) datasource).close(); } else { LOG.warn("Finalise - Could not close datasource for Database " + getURL() + "(" + toString() + ") with ClassLoader " + getClass().getClassLoader() + " - " + datasource.getClass().toString()); } }
/** * {@inheritDoc} */ @Override public void finalize() throws Throwable { super.finalize(); if (datasource instanceof com.zaxxer.hikari.HikariDataSource) { LOG.info("Finalise - Closing datasource for Database " + getURL() + "(" + toString() + ") with ClassLoader " + getClass().getClassLoader()); ((com.zaxxer.hikari.HikariDataSource) datasource).close(); } else if (datasource instanceof org.postgresql.ds.PGPoolingDataSource) { LOG.info("Finalise - Closing datasource for Database " + getURL() + "(" + toString() + ") with ClassLoader " + getClass().getClassLoader()); ((org.postgresql.ds.PGPoolingDataSource) datasource).close(); } else if (datasource instanceof org.postgresql.jdbc2.optional.PoolingDataSource) { LOG.info("Finalise - Closing datasource for Database " + getURL() + "(" + toString() + ") with ClassLoader " + getClass().getClassLoader()); ((org.postgresql.jdbc2.optional.PoolingDataSource) datasource).close(); } else { LOG.warn("Finalise - Could not close datasource for Database " + getURL() + "(" + toString() + ") with ClassLoader " + getClass().getClassLoader() + " - " + datasource.getClass().toString()); } }
LOG.info("Shutdown - Closing datasource for Database " + getURL() + "(" + toString()); ((com.zaxxer.hikari.HikariDataSource) datasource).close(); } else if (datasource instanceof org.postgresql.ds.PGPoolingDataSource) { LOG.info("Shutdown - Closing datasource for Database " + getURL() + "(" + toString() + ") with ClassLoader " + getClass().getClassLoader()); ((org.postgresql.ds.PGPoolingDataSource) datasource).close(); } else if (datasource instanceof org.postgresql.jdbc2.optional.PoolingDataSource) { LOG.info("Shutdown - Closing datasource for Database " + getURL() + "(" + toString() + ") with ClassLoader " + getClass().getClassLoader()); ((org.postgresql.jdbc2.optional.PoolingDataSource) datasource).close(); } else { LOG.warn("Shutdown - Could not close datasource for Database " + getURL() + "(" + toString() + ") with ClassLoader " + getClass().getClassLoader() + " - " + datasource.getClass().toString());
LOG.info("Shutdown - Closing datasource for Database " + getURL() + "(" + toString()); ((com.zaxxer.hikari.HikariDataSource) datasource).close(); } else if (datasource instanceof org.postgresql.ds.PGPoolingDataSource) { LOG.info("Shutdown - Closing datasource for Database " + getURL() + "(" + toString() + ") with ClassLoader " + getClass().getClassLoader()); ((org.postgresql.ds.PGPoolingDataSource) datasource).close(); } else if (datasource instanceof org.postgresql.jdbc2.optional.PoolingDataSource) { LOG.info("Shutdown - Closing datasource for Database " + getURL() + "(" + toString() + ") with ClassLoader " + getClass().getClassLoader()); ((org.postgresql.jdbc2.optional.PoolingDataSource) datasource).close(); } else { LOG.warn("Shutdown - Could not close datasource for Database " + getURL() + "(" + toString() + ") with ClassLoader " + getClass().getClassLoader() + " - " + datasource.getClass().toString());
} catch (SQLException e) { throw new ObjectStoreException("Could not obtain connection to database " + db.getURL() + "(user=" + db.getUser() + ")", e);
} catch (SQLException e) { throw new ObjectStoreException("Could not obtain connection to database " + db.getURL() + "(user=" + db.getUser() + ")", e);
LOG.info("Creating new Database " + getURL() + "(" + toString() + ") and parallelism " + parallel); } catch (Exception e) {
LOG.info("Creating new Database " + getURL() + "(" + toString() + ") and parallelism " + parallel); } catch (Exception e) {
public void testURL() throws Exception { Database db = new Database(props); assertEquals("jdbc:postgresql://dbserver.mydomain.org/test", db.getURL()); }
isql.setUrl(database.getURL()); // "jdbc:postgresql://localhost/test"
isql.setUrl(database.getURL()); // "jdbc:postgresql://localhost/test"