Package org.apache.ibatis.transaction.managed

Examples of org.apache.ibatis.transaction.managed.ManagedTransactionFactory


  public DefaultSqlSessionFactory(Configuration configuration) {
    this.configuration = configuration;
    this.environment = configuration.getEnvironment();
    if (environment == null) {
      this.dataSource = null;
      this.transactionFactory = new ManagedTransactionFactory();
    } else {
      this.dataSource = environment.getDataSource();
      this.transactionFactory = environment.getTransactionFactory();
    }
  }
View Full Code Here


    Environment original = sqlSessionFactory.getConfiguration().getEnvironment();

    MockDataSource mockDataSource = new MockDataSource();
    mockDataSource.setupConnection(createMockConnection());

    Environment nonSpring = new Environment("non-spring", new ManagedTransactionFactory(), mockDataSource);
    sqlSessionFactory.getConfiguration().setEnvironment(nonSpring);

    JtaTransactionManager jtaManager = new JtaTransactionManager(new MockUserTransaction());

    DefaultTransactionDefinition txDef = new DefaultTransactionDefinition();
View Full Code Here

  // myBatis SqlSessionFactory ////////////////////////////////////////////////

  protected void initTransactionFactory() {
    if (transactionFactory==null) {
      if (transactionsExternallyManaged) {
        transactionFactory = new ManagedTransactionFactory();
      } else {
        transactionFactory = new JdbcTransactionFactory();
      }
    }
  }
View Full Code Here

  private final Configuration configuration;
  private final TransactionFactory managedTransactionFactory;

  public DefaultSqlSessionFactory(Configuration configuration) {
    this.configuration = configuration;
    this.managedTransactionFactory = new ManagedTransactionFactory();
  }
View Full Code Here

  private final Configuration configuration;
  private final TransactionFactory managedTransactionFactory;

  public DefaultSqlSessionFactory(Configuration configuration) {
    this.configuration = configuration;
    this.managedTransactionFactory = new ManagedTransactionFactory();
  }
View Full Code Here

  private final Configuration configuration;
  private final TransactionFactory managedTransactionFactory;

  public DefaultSqlSessionFactory(Configuration configuration) {
    this.configuration = configuration;
    this.managedTransactionFactory = new ManagedTransactionFactory();
  }
View Full Code Here

  private final Configuration configuration;
  private final TransactionFactory managedTransactionFactory;

  public DefaultSqlSessionFactory(Configuration configuration) {
    this.configuration = configuration;
    this.managedTransactionFactory = new ManagedTransactionFactory();
  }
View Full Code Here

    }
  }

  private TransactionFactory getTransactionFactoryFromEnvironment(Environment environment) {
    if (environment == null || environment.getTransactionFactory() == null) {
      return new ManagedTransactionFactory();
    }
    return environment.getTransactionFactory();
  }
View Full Code Here

        DataSource dataSourceToUse = this.dataSource;
        if (this.useTransactionAwareDataSource  && !(this.dataSource instanceof TransactionAwareDataSourceProxy)) { 
                dataSourceToUse = new TransactionAwareDataSourceProxy(this.dataSource)
            }
       
        conf.setEnvironment(new Environment("development",new ManagedTransactionFactory(),dataSourceToUse));
        sqlSessionFactory = new SqlSessionFactoryBuilder().build(conf);
      }
     
      if(mapperLocations != null) {
        Map<String, XNode> sqlFragments = new HashMap<String, XNode>();
View Full Code Here

  // myBatis SqlSessionFactory ////////////////////////////////////////////////
 
  protected void initTransactionFactory() {
    if (transactionFactory==null) {
      if (transactionsExternallyManaged) {
        transactionFactory = new ManagedTransactionFactory();
      } else {
        transactionFactory = new JdbcTransactionFactory();
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.ibatis.transaction.managed.ManagedTransactionFactory

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.