Examples of ConnectionHolder


Examples of org.springframework.jdbc.datasource.ConnectionHolder

            "Could not obtain Hibernate-managed Session for Spring-managed transaction", ex);
      }
    }

    if (getDataSource() != null) {
      ConnectionHolder conHolder = (ConnectionHolder)
          TransactionSynchronizationManager.getResource(getDataSource());
      txObject.setConnectionHolder(conHolder);
    }

    return txObject;
View Full Code Here

Examples of org.springframework.jdbc.datasource.ConnectionHolder

      txObject.getSessionHolder().setTransaction(hibTx);

      // Register the Hibernate Session's JDBC Connection for the DataSource, if set.
      if (getDataSource() != null) {
        Connection con = session.connection();
        ConnectionHolder conHolder = new ConnectionHolder(con);
        if (timeout != TransactionDefinition.TIMEOUT_DEFAULT) {
          conHolder.setTimeoutInSeconds(timeout);
        }
        if (logger.isDebugEnabled()) {
          logger.debug("Exposing Hibernate transaction as JDBC transaction [" + con + "]");
        }
        TransactionSynchronizationManager.bindResource(getDataSource(), conHolder);
View Full Code Here

Examples of org.springframework.jdbc.datasource.ConnectionHolder

    HibernateTransactionObject txObject = (HibernateTransactionObject) transaction;
    txObject.setSessionHolder(null);
    SessionHolder sessionHolder =
        (SessionHolder) TransactionSynchronizationManager.unbindResource(getSessionFactory());
    txObject.setConnectionHolder(null);
    ConnectionHolder connectionHolder = null;
    if (getDataSource() != null) {
      connectionHolder = (ConnectionHolder) TransactionSynchronizationManager.unbindResource(getDataSource());
    }
    return new SuspendedResourcesHolder(sessionHolder, connectionHolder);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.