@SuppressWarnings("deprecation") public void resetSessionState() { if (this.previousFlushMode != null) { this.session.setFlushMode(this.previousFlushMode); } if (this.preparedCon != null && this.session.isConnected()) { Connection conToReset = HibernateConnectionHandle.doGetConnection(this.session); if (conToReset != this.preparedCon) { LogFactory.getLog(HibernateJpaDialect.class).warn( "JDBC Connection to reset not identical to originally prepared Connection - please " + "make sure to use connection release mode ON_CLOSE (the default) and to run against " + "Hibernate 4.2+ (or switch HibernateJpaDialect's prepareConnection flag to false"); } DataSourceUtils.resetConnectionAfterTransaction(conToReset, this.previousIsolationLevel); } } }
@SuppressWarnings("deprecation") public void resetSessionState() { if (this.previousFlushMode != null) { this.session.setFlushMode(this.previousFlushMode); } if (this.preparedCon != null && this.session.isConnected()) { Connection conToReset = HibernateConnectionHandle.doGetConnection(this.session); if (conToReset != this.preparedCon) { LogFactory.getLog(HibernateJpaDialect.class).warn( "JDBC Connection to reset not identical to originally prepared Connection - please " + "make sure to use connection release mode ON_CLOSE (the default) and to run against " + "Hibernate 4.2+ (or switch HibernateJpaDialect's prepareConnection flag to false"); } DataSourceUtils.resetConnectionAfterTransaction(conToReset, this.previousIsolationLevel); } } }
@Override protected void doCleanupAfterCompletion(Object transaction) { DataSourceTransactionObject txObject = (DataSourceTransactionObject) transaction; // Remove the connection holder from the thread, if exposed. if (txObject.isNewConnectionHolder()) { TransactionSynchronizationManager.unbindResource(obtainDataSource()); } // Reset connection. Connection con = txObject.getConnectionHolder().getConnection(); try { if (txObject.isMustRestoreAutoCommit()) { con.setAutoCommit(true); } DataSourceUtils.resetConnectionAfterTransaction(con, txObject.getPreviousIsolationLevel()); } catch (Throwable ex) { logger.debug("Could not reset JDBC Connection after transaction", ex); } if (txObject.isNewConnectionHolder()) { if (logger.isDebugEnabled()) { logger.debug("Releasing JDBC Connection [" + con + "] after transaction"); } DataSourceUtils.releaseConnection(con, this.dataSource); } txObject.getConnectionHolder().clear(); }
con.setHoldability(previousHoldability); DataSourceUtils.resetConnectionAfterTransaction(con, txObject.getPreviousIsolationLevel());
con.setHoldability(previousHoldability); DataSourceUtils.resetConnectionAfterTransaction(con, txObject.getPreviousIsolationLevel());
@SuppressWarnings("deprecation") public void resetSessionState() { if (this.previousFlushMode != null) { this.session.setFlushMode(this.previousFlushMode); } if (this.preparedCon != null && this.session.isConnected()) { Connection conToReset = HibernateConnectionHandle.doGetConnection(this.session); if (conToReset != this.preparedCon) { LogFactory.getLog(HibernateJpaDialect.class).warn( "JDBC Connection to reset not identical to originally prepared Connection - please " + "make sure to use connection release mode ON_CLOSE (the default) and to run against " + "Hibernate 4.2+ (or switch HibernateJpaDialect's prepareConnection flag to false"); } DataSourceUtils.resetConnectionAfterTransaction(conToReset, this.previousIsolationLevel); } } }
@Override protected void doCleanupAfterCompletion(Object transaction) { DataSourceTransactionObject txObject = (DataSourceTransactionObject) transaction; // Remove the connection holder from the thread, if exposed. if (txObject.isNewConnectionHolder()) { TransactionSynchronizationManager.unbindResource(this.dataSource); } // Reset connection. Connection con = txObject.getConnectionHolder().getConnection(); try { if (txObject.isMustRestoreAutoCommit()) { con.setAutoCommit(true); } DataSourceUtils.resetConnectionAfterTransaction(con, txObject.getPreviousIsolationLevel()); } catch (Throwable ex) { logger.debug("Could not reset JDBC Connection after transaction", ex); } if (txObject.isNewConnectionHolder()) { if (logger.isDebugEnabled()) { logger.debug("Releasing JDBC Connection [" + con + "] after transaction"); } DataSourceUtils.releaseConnection(con, this.dataSource); } txObject.getConnectionHolder().clear(); }
con.setHoldability(previousHoldability); DataSourceUtils.resetConnectionAfterTransaction(con, txObject.getPreviousIsolationLevel());
@Override protected void doCleanupAfterCompletion(Object transaction) { DataSourceTransactionObject txObject = (DataSourceTransactionObject) transaction; // Remove the connection holder from the thread, if exposed. if (txObject.isNewConnectionHolder()) { TransactionSynchronizationManager.unbindResource(obtainDataSource()); } // Reset connection. Connection con = txObject.getConnectionHolder().getConnection(); try { if (txObject.isMustRestoreAutoCommit()) { con.setAutoCommit(true); } DataSourceUtils.resetConnectionAfterTransaction(con, txObject.getPreviousIsolationLevel()); } catch (Throwable ex) { logger.debug("Could not reset JDBC Connection after transaction", ex); } if (txObject.isNewConnectionHolder()) { if (logger.isDebugEnabled()) { logger.debug("Releasing JDBC Connection [" + con + "] after transaction"); } DataSourceUtils.releaseConnection(con, this.dataSource); } txObject.getConnectionHolder().clear(); }
protected void doCleanupAfterCompletion(Object transaction) { PersistenceBrokerTransactionObject txObject = (PersistenceBrokerTransactionObject) transaction; // Remove the persistence broker holder from the thread. TransactionSynchronizationManager.unbindResource(getPbKey()); txObject.getPersistenceBrokerHolder().clear(); // Remove the JDBC connection holder from the thread, if set. if (getDataSource() != null) { TransactionSynchronizationManager.unbindResource(getDataSource()); } PersistenceBroker pb = txObject.getPersistenceBrokerHolder().getPersistenceBroker(); try { Connection con = pb.serviceConnectionManager().getConnection(); DataSourceUtils.resetConnectionAfterTransaction(con, txObject.getPreviousIsolationLevel()); } catch (LookupException ex) { logger.info("Could not look up JDBC Connection of OJB PersistenceBroker", ex); } if (logger.isDebugEnabled()) { logger.debug("Closing OJB PersistenceBroker [" + pb + "] after transaction"); } releasePersistenceBroker(pb); }
protected void doCleanupAfterCompletion(Object transaction) { PersistenceBrokerTransactionObject txObject = (PersistenceBrokerTransactionObject) transaction; // Remove the persistence broker holder from the thread. TransactionSynchronizationManager.unbindResource(getPbKey()); txObject.getPersistenceBrokerHolder().clear(); // Remove the JDBC connection holder from the thread, if set. if (getDataSource() != null) { TransactionSynchronizationManager.unbindResource(getDataSource()); } PersistenceBroker pb = txObject.getPersistenceBrokerHolder().getPersistenceBroker(); try { Connection con = pb.serviceConnectionManager().getConnection(); DataSourceUtils.resetConnectionAfterTransaction(con, txObject.getPreviousIsolationLevel()); } catch (LookupException ex) { logger.info("Could not look up JDBC Connection of OJB PersistenceBroker", ex); } if (logger.isDebugEnabled()) { logger.debug("Closing OJB PersistenceBroker [" + pb + "] after transaction"); } releasePersistenceBroker(pb); }
protected void doCleanupAfterCompletion(Object transaction) { PersistenceBrokerTransactionObject txObject = (PersistenceBrokerTransactionObject) transaction; // Remove the persistence broker holder from the thread. TransactionSynchronizationManager.unbindResource(getPbKey()); txObject.getPersistenceBrokerHolder().clear(); // Remove the JDBC connection holder from the thread, if set. if (getDataSource() != null) { TransactionSynchronizationManager.unbindResource(getDataSource()); } PersistenceBroker pb = txObject.getPersistenceBrokerHolder().getPersistenceBroker(); try { Connection con = pb.serviceConnectionManager().getConnection(); DataSourceUtils.resetConnectionAfterTransaction(con, txObject.getPreviousIsolationLevel()); } catch (LookupException ex) { logger.info("Could not look up JDBC Connection of OJB PersistenceBroker", ex); } if (logger.isDebugEnabled()) { logger.debug("Closing OJB PersistenceBroker [" + pb + "] after transaction"); } releasePersistenceBroker(pb); }
try { Connection con = session.getConnection(); DataSourceUtils.resetConnectionAfterTransaction(con, txObject.getPreviousIsolationLevel()); } catch (Exception ex) { logger.debug("Could not access JDBC Connection of Anteros SQLSession", ex);
con.setHoldability(previousHoldability); DataSourceUtils.resetConnectionAfterTransaction(con, txObject.getPreviousIsolationLevel());
@SuppressWarnings("deprecation") Connection con = session.connection(); DataSourceUtils.resetConnectionAfterTransaction(con, txObject.getPreviousIsolationLevel()); } catch (HibernateException ex) { logger.debug("Could not access JDBC Connection of Hibernate Session", ex);
DataSourceUtils.resetConnectionAfterTransaction(con, txObject.getPreviousIsolationLevel());