Package org.springframework.jdbc.datasource

Examples of org.springframework.jdbc.datasource.ConnectionHandle


        txObject.getEntityManagerHolder().setTimeoutInSeconds(timeoutToUse);
      }

      // Register the JPA EntityManager's JDBC Connection for the DataSource, if set.
      if (getDataSource() != null) {
        ConnectionHandle conHandle = getJpaDialect().getJdbcConnection(em, definition.isReadOnly());
        if (conHandle != null) {
          ConnectionHolder conHolder = new ConnectionHolder(conHandle);
          if (timeoutToUse != TransactionDefinition.TIMEOUT_DEFAULT) {
            conHolder.setTimeoutInSeconds(timeoutToUse);
          }
View Full Code Here


  @Test
  public void testTransactionCommitWithDataSource() throws SQLException {
    final DataSource ds = mock(DataSource.class);
    JdoDialect dialect = mock(JdoDialect.class);
    final Connection con = mock(Connection.class);
    ConnectionHandle conHandle = new SimpleConnectionHandle(con);

    given(pmf.getPersistenceManager()).willReturn(pm);
    given(pm.currentTransaction()).willReturn(tx);
    TransactionTemplate tt = new TransactionTemplate();
    given(dialect.getJdbcConnection(pm, false)).willReturn(conHandle);
View Full Code Here

  @Test
  public void testTransactionCommitWithAutoDetectedDataSource() throws SQLException {
    final DataSource ds = mock(DataSource.class);
    JdoDialect dialect = mock(JdoDialect.class);
    final Connection con = mock(Connection.class);
    ConnectionHandle conHandle = new SimpleConnectionHandle(con);

    given(pmf.getConnectionFactory()).willReturn(ds);
    given(pmf.getPersistenceManager()).willReturn(pm);
    given(pm.currentTransaction()).willReturn(tx);
    TransactionTemplate tt = new TransactionTemplate();
View Full Code Here

    given(md.supportsSavepoints()).willReturn(true);
    given(con.getMetaData()).willReturn(md);
    given(con.setSavepoint(ConnectionHolder.SAVEPOINT_NAME_PREFIX + 1)).willReturn(sp);
    final TransactionTemplate tt = new TransactionTemplate();
    tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_NESTED);
    ConnectionHandle conHandle = new SimpleConnectionHandle(con);
    given(dialect.getJdbcConnection(pm, false)).willReturn(conHandle);
    given(tx.isActive()).willReturn(!manualSavepoint);

    JdoTransactionManager tm = new JdoTransactionManager();
    tm.setNestedTransactionAllowed(true);
View Full Code Here

        txObject.getPersistenceManagerHolder().setTimeoutInSeconds(timeoutToUse);
      }

      // Register the JDO PersistenceManager's JDBC Connection for the DataSource, if set.
      if (getDataSource() != null) {
        ConnectionHandle conHandle = getJdoDialect().getJdbcConnection(pm, definition.isReadOnly());
        if (conHandle != null) {
          ConnectionHolder conHolder = new ConnectionHolder(conHandle);
          if (timeoutToUse != TransactionDefinition.TIMEOUT_DEFAULT) {
            conHolder.setTimeoutInSeconds(timeoutToUse);
          }
View Full Code Here

        txObject.getPersistenceManagerHolder().setTimeoutInSeconds(timeoutToUse);
      }

      // Register the JDO PersistenceManager's JDBC Connection for the DataSource, if set.
      if (getDataSource() != null) {
        ConnectionHandle conHandle = getJdoDialect().getJdbcConnection(pm, definition.isReadOnly());
        if (conHandle != null) {
          ConnectionHolder conHolder = new ConnectionHolder(conHandle);
          if (timeoutToUse != TransactionDefinition.TIMEOUT_DEFAULT) {
            conHolder.setTimeoutInSeconds(timeoutToUse);
          }
View Full Code Here

        txObject.getEntityManagerHolder().setTimeoutInSeconds(timeoutToUse);
      }

      // Register the JPA EntityManager's JDBC Connection for the DataSource, if set.
      if (getDataSource() != null) {
        ConnectionHandle conHandle = getJpaDialect().getJdbcConnection(em, definition.isReadOnly());
        if (conHandle != null) {
          ConnectionHolder conHolder = new ConnectionHolder(conHandle);
          if (timeoutToUse != TransactionDefinition.TIMEOUT_DEFAULT) {
            conHolder.setTimeoutInSeconds(timeoutToUse);
          }
View Full Code Here

TOP

Related Classes of org.springframework.jdbc.datasource.ConnectionHandle

Copyright © 2018 www.massapicom. 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.