TopicMapStoreIF store = tm.getStore(); try { store.abort(); } catch (Exception ex) { log.error("Problems occured while aborting transaction", ex);
store.commit(); } catch (Exception e) { store.abort(); throw e; } finally {
TopicMapStoreIF store = tm.getStore(); try { store.abort(); } catch (Exception ex) { log.error("Problems occured while aborting transaction", ex);
store.commit(); } catch (Exception e) { store.abort(); throw e; } finally {
@Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { String repositoryId = getRepositoryId(request); String topicMapId = getTopicMapId(request); boolean readOnly = getReadOnly(request); TopicMapStoreIF store; if (repositoryId == null) store = TopicMaps.createStore(topicMapId, readOnly); else store = TopicMaps.createStore(topicMapId, readOnly, repositoryId); try { data.set(store); chain.doFilter(request, response); if (!readOnly) store.commit(); } catch (Exception e) { if (!readOnly) store.abort(); log.error("Exception thrown from doFilter.", e); } finally { data.set(null); store.close(); } }
@Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { String repositoryId = getRepositoryId(request); String topicMapId = getTopicMapId(request); boolean readOnly = getReadOnly(request); String requestAttribute = getRequestAttribute(request); TopicMapStoreIF store; if (repositoryId == null) store = TopicMaps.createStore(topicMapId, readOnly); else store = TopicMaps.createStore(topicMapId, readOnly, repositoryId); try { request.setAttribute(requestAttribute, store); chain.doFilter(request, response); if (!readOnly) store.commit(); } catch (Exception e) { if (!readOnly) store.abort(); log.error("Exception thrown from doFilter.", e); } finally { request.removeAttribute(requestAttribute); store.close(); } }
targetStore.abort(); throw new ServletException(e); } finally {
log.error("Error occurred while running operation '" + operation + "'", t); store.abort(); log.debug("Transaction aborted."); throw t;
log.error("Error occurred while running operation '" + operation + "'", t); store.abort(); log.debug("Transaction aborted."); throw t;
log.error("Error occurred", t); store.abort(); log.debug("Transaction aborted."); throw t;
store.abort(); logger.debug("Transaction rolled back");
store1.abort();
public void testTransactionAbort() throws IOException { TopicMapEvents.addTopicListener(topicmapRef, new AbstractTopicMapListener() { @Override public void objectAdded(TMObjectIF snapshot) { added++; } }); TopicMapStoreIF store = null; try { store = topicmapRef.createStore(false); store.getTopicMap().getBuilder().makeTopic(); // before commit: 0 calls should have been made to objectAdded assertEquals(0, added); store.abort(); // after abort: 0 calls should have been made to objectAdded assertEquals(0, added); } finally { store.close(); } } }
if (store != null) store.abort(); throw new OntopiaRuntimeException(e); } finally {
if (store != null) store.abort(); throw new OntopiaRuntimeException(e); } finally {
assertTrue("_topic2 != null", _topic2 == null); store1.abort();