List of usage examples for org.hibernate SharedSessionContract getTransaction
Transaction getTransaction();
From source file:org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStore.java
License:Apache License
/** * Rolls back hibernate session./*from w ww . java2 s . c o m*/ * * @param ses Hibernate session. * @param tx Cache ongoing transaction. */ private void rollback(SharedSessionContract ses, Transaction tx) { // Rollback only if there is no cache transaction, // otherwise sessionEnd() will do all required work. if (tx == null) { org.hibernate.Transaction hTx = ses.getTransaction(); if (hTx != null && hTx.isActive()) hTx.rollback(); } }
From source file:org.gridgain.grid.cache.store.hibernate.GridCacheHibernateBlobStore.java
License:Open Source License
/** * Rolls back hibernate session.//from www. j a v a2s.co m * * @param ses Hibernate session. * @param tx Cache ongoing transaction. */ private void rollback(SharedSessionContract ses, GridCacheTx tx) { // Rollback only if there is no cache transaction, // otherwise txEnd() will do all required work. if (tx == null) { Transaction hTx = ses.getTransaction(); if (hTx != null && hTx.isActive()) hTx.rollback(); } }