@Test public void testAbort2() throws SQLException { Context instance = new Context(); instance.abort(); instance.abort(); cleanupContext(instance); }
public void abort() { if (!isValid()) { log.info("abort() was called on a closed Context object. No changes to abort."); return; } try { if (!isReadOnly() && isTransactionAlive()) { dbConnection.rollback(); } } catch (SQLException se) { log.error("Error rolling back transaction during an abort()", se); } finally { try { if (dbConnection != null) { dbConnection.closeDBConnection(); dbConnection = null; } } catch (Exception ex) { log.error("Error closing the database connection", ex); } events = null; } }
Context implements AutoCloseable { public void abort() { if (!isValid()) { log.info("abort() was called on a closed Context object. No changes to abort."); return; } try { if (!isReadOnly() && isTransactionAlive()) { dbConnection.rollback(); } } catch (SQLException se) { log.error("Error rolling back transaction during an abort()", se); } finally { try { if (dbConnection != null) { dbConnection.closeDBConnection(); dbConnection = null; } } catch (Exception ex) { log.error("Error closing the database connection", ex); } events = null; } } }
Context implements AutoCloseable { public void abort() { if (!isValid()) { log.info("abort() was called on a closed Context object. No changes to abort."); return; } try { if (!isReadOnly() && isTransactionAlive()) { dbConnection.rollback(); } } catch (SQLException se) { log.error("Error rolling back transaction during an abort()", se); } finally { try { if (dbConnection != null) { dbConnection.closeDBConnection(); dbConnection = null; } } catch (Exception ex) { log.error("Error closing the database connection", ex); } events = null; } } protected  Context(EventService eventService, DBConnection dbConnection);  Context();  Context(Mode mode); }
Context implements AutoCloseable { public void abort() { if (!isValid()) { log.info("abort() was called on a closed Context object. No changes to abort."); return; } try { if (!isReadOnly() && isTransactionAlive()) { dbConnection.rollback(); } } catch (SQLException se) { log.error("Error rolling back transaction during an abort()", se); } finally { try { if (dbConnection != null) { dbConnection.closeDBConnection(); dbConnection = null; } } catch (Exception ex) { log.error("Error closing the database connection", ex); } events = null; } } protected  Context(EventService eventService, DBConnection dbConnection);  Context();  Context(Mode mode); static synchronized boolean updateDatabase(); DatabaseConfigVO getDBConfig(); String getDbType(); void setCurrentUser(EPerson user); EPerson getCurrentUser(); Locale getCurrentLocale(); void setCurrentLocale(Locale locale); boolean ignoreAuthorization(); void turnOffAuthorisationSystem(); void restoreAuthSystemState(); void setExtraLogInfo(String info); String getExtraLogInfo(); void complete(); void commit(); void dispatchEvents(); void setDispatcher(String dispatcher); void addEvent(Event event); LinkedList<Event> getEvents(); boolean hasEvents(); Event pollEvent(); void abort(); @Override void close(); boolean isValid(); boolean isReadOnly(); void setSpecialGroup(UUID groupID); boolean inSpecialGroup(UUID groupID); List<Group> getSpecialGroups(); void switchContextUser(EPerson newUser); void restoreContextUser(); void shutDownDatabase(); long getCacheSize(); void setMode(Mode newMode); Mode getCurrentMode(); @Deprecated void enableBatchMode(boolean batchModeEnabled); @Deprecated boolean isBatchModeEnabled(); @SuppressWarnings("unchecked") E reloadEntity(E entity); @SuppressWarnings("unchecked") void uncacheEntity(E entity); Boolean getCachedAuthorizationResult(DSpaceObject dspaceObject, int action, EPerson eperson); void cacheAuthorizedAction(DSpaceObject dspaceObject, int action, EPerson eperson, Boolean result,
                                      ResourcePolicy rp); Boolean getCachedGroupMembership(Group group, EPerson eperson); void cacheGroupMembership(Group group, EPerson eperson, Boolean isMember); void cacheAllMemberGroupsSet(EPerson ePerson, Set<Group> groups); Set<Group> getCachedAllMemberGroupsSet(EPerson ePerson); }
Context implements AutoCloseable { public void abort() { if (!isValid()) { log.info("abort() was called on a closed Context object. No changes to abort."); return; } try { if (!isReadOnly() && isTransactionAlive()) { dbConnection.rollback(); } } catch (SQLException se) { log.error("Error rolling back transaction during an abort()", se); } finally { try { if (dbConnection != null) { dbConnection.closeDBConnection(); dbConnection = null; } } catch (Exception ex) { log.error("Error closing the database connection", ex); } events = null; } } protected  Context(EventService eventService, DBConnection dbConnection);  Context();  Context(Mode mode); static synchronized boolean updateDatabase(); DatabaseConfigVO getDBConfig(); String getDbType(); void setCurrentUser(EPerson user); EPerson getCurrentUser(); Locale getCurrentLocale(); void setCurrentLocale(Locale locale); boolean ignoreAuthorization(); void turnOffAuthorisationSystem(); void restoreAuthSystemState(); void setExtraLogInfo(String info); String getExtraLogInfo(); void complete(); void commit(); void dispatchEvents(); void setDispatcher(String dispatcher); void addEvent(Event event); LinkedList<Event> getEvents(); boolean hasEvents(); Event pollEvent(); void abort(); @Override void close(); boolean isValid(); boolean isReadOnly(); void setSpecialGroup(UUID groupID); boolean inSpecialGroup(UUID groupID); List<Group> getSpecialGroups(); void switchContextUser(EPerson newUser); void restoreContextUser(); void shutDownDatabase(); long getCacheSize(); void setMode(Mode newMode); Mode getCurrentMode(); @Deprecated void enableBatchMode(boolean batchModeEnabled); @Deprecated boolean isBatchModeEnabled(); @SuppressWarnings("unchecked") E reloadEntity(E entity); @SuppressWarnings("unchecked") void uncacheEntity(E entity); Boolean getCachedAuthorizationResult(DSpaceObject dspaceObject, int action, EPerson eperson); void cacheAuthorizedAction(DSpaceObject dspaceObject, int action, EPerson eperson, Boolean result,
                                      ResourcePolicy rp); Boolean getCachedGroupMembership(Group group, EPerson eperson); void cacheGroupMembership(Group group, EPerson eperson, Boolean isMember); void cacheAllMemberGroupsSet(EPerson ePerson, Set<Group> groups); Set<Group> getCachedAllMemberGroupsSet(EPerson ePerson);  }