Package org.springframework.jdbc.datasource

Examples of org.springframework.jdbc.datasource.DataSourceTransactionManager


        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


   
    if(applicationContext.containsBean("custom_transactionManager")){
      return (PlatformTransactionManager)applicationContext.getBean("custom_transactionManager");
    }
   
    return new DataSourceTransactionManager(dataSource());
  }
View Full Code Here

        JdbcConfiguration conf =
                (JdbcConfiguration) databaseConnectionManager.getConfiguration(connectionName);
        /** Query datasource from configuration object. */
        dataSource = conf.getDataSource();       
       
        txManager = new DataSourceTransactionManager(dataSource);
        jdbcTemplate = new JdbcTemplate(dataSource);
    }
View Full Code Here

        return new DaoImpl();
    }

    @org.springframework.config.java.annotation.Bean
    public PlatformTransactionManager myTransactionManager() {
        return new DataSourceTransactionManager(dataSource());
    }
View Full Code Here

    public AbstractDbDialect(final JdbcTemplate jdbcTemplate, LobHandler lobHandler){
        this.jdbcTemplate = jdbcTemplate;
        this.lobHandler = lobHandler;
        // 初始化transction
        this.transactionTemplate = new TransactionTemplate();
        transactionTemplate.setTransactionManager(new DataSourceTransactionManager(jdbcTemplate.getDataSource()));
        transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);

        // 初始化一些数据
        jdbcTemplate.execute(new ConnectionCallback() {
View Full Code Here

                             int minorVersion){
        this.jdbcTemplate = jdbcTemplate;
        this.lobHandler = lobHandler;
        // 初始化transction
        this.transactionTemplate = new TransactionTemplate();
        transactionTemplate.setTransactionManager(new DataSourceTransactionManager(jdbcTemplate.getDataSource()));
        transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);

        this.databaseName = name;
        this.databaseMajorVersion = majorVersion;
        this.databaseMinorVersion = minorVersion;
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

       
        ds = new SingleConnectionDataSource(url, user, password, true);
        ((DriverManagerDataSource) ds).setDriverClassName(driverClass);
        reg.bind("testdb", ds);
       
        DataSourceTransactionManager txMgr = new DataSourceTransactionManager();
        txMgr.setDataSource(ds);
        reg.bind("txManager", txMgr);
       
        SpringTransactionPolicy txPolicy = new SpringTransactionPolicy();
        txPolicy.setTransactionManager(txMgr);
        txPolicy.setPropagationBehaviorName("PROPAGATION_REQUIRED");
View Full Code Here

    public AbstractDbDialect(final JdbcTemplate jdbcTemplate, LobHandler lobHandler){
        this.jdbcTemplate = jdbcTemplate;
        this.lobHandler = lobHandler;
        // 初始化transction
        this.transactionTemplate = new TransactionTemplate();
        transactionTemplate.setTransactionManager(new DataSourceTransactionManager(jdbcTemplate.getDataSource()));
        transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);

        // 初始化一些数据
        jdbcTemplate.execute(new ConnectionCallback() {
View Full Code Here

                             int minorVersion){
        this.jdbcTemplate = jdbcTemplate;
        this.lobHandler = lobHandler;
        // 初始化transction
        this.transactionTemplate = new TransactionTemplate();
        transactionTemplate.setTransactionManager(new DataSourceTransactionManager(jdbcTemplate.getDataSource()));
        transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);

        this.databaseName = name;
        this.databaseMajorVersion = majorVersion;
        this.databaseMinorVersion = minorVersion;
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.