/** * Invoke close, which will be harmless if we are already closed. */ @Override protected void finalize() throws Throwable { /* * Note: Automatically closing the connection is vital for the * UNISOLATED connection. Otherwise, an application which forgets * to close() the connection could "lose" the permit required to * write on the UNISOLATED connection. By invoking close() from * within finalize(), we ensure that the permit will be returned * if a connection is garbage collection without being explicitly * closed. */ close(); super.finalize(); }
/** * Invoke close, which will be harmless if we are already closed. */ @Override protected void finalize() throws Throwable { /* * Note: Automatically closing the connection is vital for the * UNISOLATED connection. Otherwise, an application which forgets * to close() the connection could "lose" the permit required to * write on the UNISOLATED connection. By invoking close() from * within finalize(), we ensure that the permit will be returned * if a connection is garbage collection without being explicitly * closed. */ close(); super.finalize(); }
conn.close();
if (con != null) { con.rollback(); con.close();
conn.close();
/** * Unit test verifies that the history index is not created if the option is * not enabled. */ public void test_historyIndexDisabled() throws SailException { final Properties properties = getProperties(); // disable the history service. properties .setProperty( com.bigdata.rdf.store.AbstractTripleStore.Options.HISTORY_SERVICE, "false"); final BigdataSail sail = getSail(properties); try { sail.initialize(); final BigdataSailConnection conn = sail.getConnection(); try { // Resolve the index that the connection will write on. final IIndex ndx = getHistoryIndex(conn.getTripleStore()); // The index should not exist. assertNull(ndx); conn.rollback(); } finally { conn.close(); } } finally { sail.__tearDownUnitTest(); } }
/** * Unit test verifies that the history index is not created if the option is * not enabled. */ public void test_historyIndexDisabled() throws SailException { final Properties properties = getProperties(); // disable the history service. properties .setProperty( com.bigdata.rdf.store.AbstractTripleStore.Options.HISTORY_SERVICE, "false"); final BigdataSail sail = getSail(properties); try { sail.initialize(); final BigdataSailConnection conn = sail.getConnection(); try { // Resolve the index that the connection will write on. final IIndex ndx = getHistoryIndex(conn.getTripleStore()); // The index should not exist. assertNull(ndx); conn.rollback(); } finally { conn.close(); } } finally { sail.__tearDownUnitTest(); } }
conn.close();
conn.close();
conn.close();
conn.close();
/** * A specialized close that will also abort the current read-only * transaction. */ @Override public synchronized void close() throws SailException { if (!openConn) { return; } super.close(); if(!clusterCacheBugFix) { try { txService.abort(tx); } catch (IOException ex) { throw new SailException(ex); } } }
/** * A specialized close that will also abort the current read-only * transaction. */ @Override public synchronized void close() throws SailException { if (!openConn) { return; } super.close(); if(!clusterCacheBugFix) { try { txService.abort(tx); } catch (IOException ex) { throw new SailException(ex); } } }
/** * A specialized close that will also abort the current read/write * transaction. */ @Override public synchronized void close() throws SailException { if (!openConn) { return; } super.close(); try { txService.abort(tx); } catch(IOException ex) { throw new SailException(ex); } }
/** * A specialized close that will also abort the current read/write * transaction. */ @Override public synchronized void close() throws SailException { if (!openConn) { return; } super.close(); try { txService.abort(tx); } catch(IOException ex) { throw new SailException(ex); } }