List of usage examples for org.springframework.transaction.support DefaultTransactionStatus getTransaction
public Object getTransaction()
From source file:org.springextensions.neodatis.NeoDatisTransactionManager.java
@Override protected void doRollback(DefaultTransactionStatus transactionStatus) throws TransactionException { NeoDatisTransactionObject transactionObject = (NeoDatisTransactionObject) transactionStatus .getTransaction();/*from w w w.ja v a 2s . c o m*/ logger.debug("Rolling back NeoDatis transaction on ODB [{}]", transactionObject.getODBHolder().getOdb()); try { transactionObject.getODBHolder().getOdb().rollback(); } catch (Exception e) { throw new TransactionSystemException("Could not rollback NeoDatis transaction.", e); } }
From source file:org.springextensions.db4o.Db4oTransactionManager.java
protected void doSetRollbackOnly(DefaultTransactionStatus status) { Db4oTransactionObject txObject = (Db4oTransactionObject) status.getTransaction(); logger.debug("Setting db4o transaction on object container [{}] rollback-only", txObject.getObjectContainerHolder().getObjectContainer()); txObject.setRollbackOnly();/*from w w w .ja v a 2s . com*/ }
From source file:org.springextensions.db4o.Db4oTransactionManager.java
protected void doCommit(DefaultTransactionStatus status) { Db4oTransactionObject txObject = (Db4oTransactionObject) status.getTransaction(); logger.debug("Committing db4o transaction on object container [{}]", txObject.getObjectContainerHolder().getObjectContainer()); try {//from ww w . j a v a 2 s .com txObject.getObjectContainerHolder().getObjectContainer().commit(); } catch (Exception ex) { // assumably from commit call to the underlying db4o container throw new TransactionSystemException("Could not commit db4o transaction", ex); } }
From source file:org.springextensions.db4o.Db4oTransactionManager.java
protected void doRollback(DefaultTransactionStatus status) { Db4oTransactionObject txObject = (Db4oTransactionObject) status.getTransaction(); logger.debug("Rolling back db4o transaction on object container [{}]", txObject.getObjectContainerHolder().getObjectContainer()); try {/*from w ww .ja v a 2 s .c om*/ txObject.getObjectContainerHolder().getObjectContainer().rollback(); } catch (Exception ex) { throw new TransactionSystemException("Could not roll back db4o transaction", ex); } finally { try { // TODO: refresh the container somehow } catch (Exception e) { // we already throw an exception (hold back this one). } } }
From source file:com._4dconcept.springframework.data.marklogic.datasource.ContentSourceTransactionManager.java
@Override protected void doSetRollbackOnly(DefaultTransactionStatus status) { ContentSourceTransactionObject txObject = (ContentSourceTransactionObject) status.getTransaction(); if (status.isDebug()) { logger.debug(/*ww w. java 2s . c om*/ "Setting XDBC transaction [" + txObject.getSessionHolder().getSession() + "] rollback-only"); } txObject.setRollbackOnly(); }
From source file:com._4dconcept.springframework.data.marklogic.datasource.ContentSourceTransactionManager.java
@Override protected void doCommit(DefaultTransactionStatus status) { ContentSourceTransactionObject txObject = (ContentSourceTransactionObject) status.getTransaction(); Session ses = txObject.getSessionHolder().getSession(); if (status.isDebug()) { logger.debug("Committing XDBC transaction on Session [" + ses + "]"); }/*from w w w. j a v a2s. c om*/ try { ses.commit(); } catch (XccException ex) { throw new TransactionSystemException("Could not commit XDBC transaction", ex); } }
From source file:com._4dconcept.springframework.data.marklogic.datasource.ContentSourceTransactionManager.java
@Override protected void doRollback(DefaultTransactionStatus status) { ContentSourceTransactionObject txObject = (ContentSourceTransactionObject) status.getTransaction(); Session ses = txObject.getSessionHolder().getSession(); if (status.isDebug()) { logger.debug("Rolling back XDBC transaction on Session [" + ses + "]"); }// ww w.j a v a 2 s. c o m try { ses.rollback(); } catch (XccException ex) { throw new TransactionSystemException("Could not roll back XDBC transaction", ex); } }
From source file:org.cfr.capsicum.datasource.CayenneTransactionManager.java
@Override protected void doSetRollbackOnly(DefaultTransactionStatus status) { CayenneTransactionObject txObject = (CayenneTransactionObject) status.getTransaction(); if (status.isDebug()) { logger.debug("Setting JDBC transaction [" + txObject.getConnectionHolder().getConnection() + "] rollback-only"); }// w w w . j av a 2 s . c o m txObject.setRollbackOnly(); }
From source file:org.cfr.capsicum.datasource.CayenneTransactionManager.java
@Override protected void doCommit(DefaultTransactionStatus status) { CayenneTransactionObject txObject = (CayenneTransactionObject) status.getTransaction(); Connection con = txObject.getConnectionHolder().getConnection(); if (status.isDebug()) { logger.debug("Committing JDBC transaction on Connection [" + con + "]"); }/*w w w . j a v a2s . c om*/ try { status.flush(); con.commit(); } catch (SQLException ex) { throw new TransactionSystemException("Could not commit JDBC transaction", exceptionTranslator.convertJdbcAccessException(ex)); } catch (CayenneRuntimeException ex) { throw new TransactionSystemException("Could not commit JDBC transaction", exceptionTranslator.convertAccessException(ex)); } }
From source file:org.cfr.capsicum.datasource.CayenneTransactionManager.java
@Override protected void doRollback(DefaultTransactionStatus status) { CayenneTransactionObject txObject = (CayenneTransactionObject) status.getTransaction(); Connection con = txObject.getConnectionHolder().getConnection(); ObjectContext dataContext = txObject.getConnectionHolderEx().getObjectContext(); if (status.isDebug()) { logger.debug("Rolling back JDBC transaction on Connection [" + con + "]"); }// w ww .j a va 2 s . c om try { if (dataContext != null) { dataContext.rollbackChanges(); } con.rollback(); } catch (SQLException ex) { throw new TransactionSystemException("Could not commit JDBC transaction", exceptionTranslator.convertJdbcAccessException(ex)); } catch (CayenneRuntimeException ex) { throw new TransactionSystemException("Could not commit JDBC transaction", exceptionTranslator.convertAccessException(ex)); } }