List of usage examples for org.springframework.transaction.support DefaultTransactionStatus getTransaction
public Object getTransaction()
From source file:net.sf.mmm.orient.db.impl.OrientTx.java
/** * @param txStatus the {@link DefaultTransactionStatus}. * @return the casted {@link DefaultTransactionStatus#getTransaction() transaction} object. *///from w ww . j av a2 s . com public static OrientTx of(DefaultTransactionStatus txStatus) { return (OrientTx) txStatus.getTransaction(); }
From source file:demo.util.MockedTransactionManager.java
@Override protected void doRollback(DefaultTransactionStatus status) throws TransactionException { logger.info("rollback " + status.getTransaction()); }
From source file:demo.util.MockedTransactionManager.java
@Override protected void doCommit(DefaultTransactionStatus status) throws TransactionException { logger.info("committing " + status.getTransaction()); }
From source file:org.ops4j.orient.spring.tx.OrientTransactionManager.java
@Override protected void doCommit(DefaultTransactionStatus status) throws TransactionException { OrientTransaction tx = (OrientTransaction) status.getTransaction(); ODatabaseInternal<?> db = tx.getDatabase(); log.debug("committing transaction, db.hashCode() = {}", db.hashCode()); db.commit();//from w ww .j a va 2 s . c o m }
From source file:org.ops4j.orient.spring.tx.OrientTransactionManager.java
@Override protected void doRollback(DefaultTransactionStatus status) throws TransactionException { OrientTransaction tx = (OrientTransaction) status.getTransaction(); ODatabaseInternal<?> db = tx.getDatabase(); log.debug("committing transaction, db.hashCode() = {}", db.hashCode()); db.rollback();/*from w w w . j ava 2s .c o m*/ }
From source file:com.turbospaces.spaces.tx.SpaceTransactionManager.java
@Override protected void doSetRollbackOnly(final DefaultTransactionStatus status) { SpaceTransactionObject txObject = (SpaceTransactionObject) status.getTransaction(); txObject.setRollbackOnly();/*from w ww. j a v a2 s . co m*/ }
From source file:org.develspot.data.orientdb.transaction.OrientDBTransactionManager.java
@Override protected void doCommit(DefaultTransactionStatus status) throws TransactionException { OrientDBTransactionObject txObject = (OrientDBTransactionObject) status.getTransaction(); OGraphDatabase connection = txObject.getConnectionHolder().getConnection(); if (status.isDebug()) { logger.debug("Commiting orientdb transaction on connection [" + connection + "]"); }//from ww w . j a v a2 s . com try { connection.commit(); } catch (Exception e) { throw new TransactionSystemException("Could not commit orientdb transaction:" + e.getMessage()); } }
From source file:org.develspot.data.orientdb.transaction.OrientDBTransactionManager.java
@Override protected void doRollback(DefaultTransactionStatus status) throws TransactionException { OrientDBTransactionObject txObject = (OrientDBTransactionObject) status.getTransaction(); OGraphDatabase connection = txObject.getConnectionHolder().getConnection(); if (status.isDebug()) { logger.debug("Rolling back transaction on connection [" + connection + "]"); }//from www. j a v a 2 s . c om try { connection.rollback(); } catch (Exception e) { throw new TransactionSystemException("Could not rollback orientdb transaction: " + e.getMessage()); } }
From source file:org.grails.datastore.mapping.transactions.DatastoreTransactionManager.java
@Override protected void doCommit(DefaultTransactionStatus status) throws TransactionException { TransactionObject txObject = (TransactionObject) status.getTransaction(); final SessionHolder sessionHolder = txObject.getSessionHolder(); if (status.isDebug()) { logger.debug("Committing Datastore transaction on Session [" + sessionHolder.getSession() + "]"); }//www .java 2 s. co m try { if (sessionHolder.getSession() != null) { sessionHolder.getSession().flush(); } txObject.getTransaction().commit(); } catch (DataAccessException ex) { throw new TransactionSystemException("Could not commit Datastore transaction", ex); } }
From source file:org.grails.datastore.mapping.transactions.DatastoreTransactionManager.java
@Override protected void doRollback(DefaultTransactionStatus status) throws TransactionException { TransactionObject txObject = (TransactionObject) status.getTransaction(); final SessionHolder sessionHolder = txObject.getSessionHolder(); if (status.isDebug()) { logger.debug("Rolling back Datastore transaction on Session [" + sessionHolder.getSession() + "]"); }/*from ww w . j av a 2 s.c om*/ try { txObject.getTransaction().rollback(); } catch (DataAccessException ex) { throw new TransactionSystemException("Could not rollback Datastore transaction", ex); } finally { // Clear all pending inserts/updates/deletes in the Session. // Necessary for pre-bound Sessions, to avoid inconsistent state. if (sessionHolder.getSession() != null) { sessionHolder.getSession().clear(); } } }