Package org.springframework.jdbc.datasource

Examples of org.springframework.jdbc.datasource.DataSourceTransactionManager


  @Test
  public void testExecutorType() {
    SqlSessionTemplate template = new SqlSessionTemplate(sqlSessionFactory, ExecutorType.BATCH);
    assertEquals(ExecutorType.BATCH, template.getExecutorType());

    DataSourceTransactionManager manager = new DataSourceTransactionManager(dataSource);

    TransactionStatus status = null;

    try {
      status = manager.getTransaction(new DefaultTransactionDefinition());

      // will synchronize the template with the current tx
      template.getConnection();

      SqlSessionHolder holder = (SqlSessionHolder) TransactionSynchronizationManager
View Full Code Here


          .build();
    }

    @Bean
    public PlatformTransactionManager transactionalManagerOne() {
      return new DataSourceTransactionManager(dataSource());
    }
View Full Code Here

    exceptionTranslator = new MyBatisExceptionTranslator(dataSource, true);

    sqlSessionFactory = factoryBean.getObject();

    txManager = new DataSourceTransactionManager(dataSource);
  }
View Full Code Here

    SpringApplication.run(Application.class, args);
  }

  @Bean
  public DataSourceTransactionManager transactionManager(DataSource dataSource) {
    return new DataSourceTransactionManager(dataSource);
  }
View Full Code Here

    }

    @Provides
    @Singleton
    DataSourceTransactionManager provideDataSourceTransactionManager() {
        return new DataSourceTransactionManager(new TransactionAwareDataSourceProxy(DATA_SOURCE));
    }
View Full Code Here

        return new JdbcMessageIdRepository(dataSource, processorName);
    }

    private static TransactionTemplate createTransactionTemplate(DataSource dataSource) {
        TransactionTemplate transactionTemplate = new TransactionTemplate();
        transactionTemplate.setTransactionManager(new DataSourceTransactionManager(dataSource));
        transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
        return transactionTemplate;
    }
View Full Code Here

    // create the jdbc template
    final JdbcTemplate jt = new JdbcTemplate(ds);

    // create the transaction manager
    DataSourceTransactionManager tsMan = new DataSourceTransactionManager(ds);

    // create the transaction template
    TransactionTemplate txTemplate = new TransactionTemplate(tsMan);

    // set behavior
View Full Code Here

          properties.getUrl(),
          properties.getUsername(),
          properties.getPassword(),
          true);
     
      PlatformTransactionManager txnMgr = new DataSourceTransactionManager(ds);
      DBConnectionManager conn = new DBConnectionManager(dataSourceName, ds, txnMgr, null, false);
      return conn;
    }
View Full Code Here

      DBConnectionManager conn = new DBConnectionManager(dataSourceName, ds, txnMgr, null, false);
      return conn;
    }
   
    public DBConnectionManager(String name, DataSource ds) {
        this(name, ds, new DataSourceTransactionManager(ds));
    }
View Full Code Here

          properties.getUrl(),
          properties.getUsername(),
          properties.getPassword(),
          true);
     
      PlatformTransactionManager txnMgr = new DataSourceTransactionManager(ds);
      DBConnectionManager conn = new DBConnectionManager(dataSourceName, ds, txnMgr, null, false);
      return conn;
    }
View Full Code Here

TOP

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

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.