Example usage for org.apache.ibatis.session TransactionIsolationLevel NONE

List of usage examples for org.apache.ibatis.session TransactionIsolationLevel NONE

Introduction

In this page you can find the example usage for org.apache.ibatis.session TransactionIsolationLevel NONE.

Prototype

TransactionIsolationLevel NONE

To view the source code for org.apache.ibatis.session TransactionIsolationLevel NONE.

Click Source Link

Usage

From source file:org.solmix.datax.mybatis.MybatisDataService.java

License:Open Source License

private Connection getConnection(DataSource dataSource, boolean autoCommit) {
    TransactionFactory factory = sqlSessionFactory.getConfiguration().getEnvironment().getTransactionFactory();
    org.apache.ibatis.transaction.Transaction trans = factory.newTransaction(dataSource,
            TransactionIsolationLevel.NONE, true);
    try {//from  w w  w.  j a v  a 2 s  . c o  m
        Connection conn = trans.getConnection();
        conn.setAutoCommit(autoCommit);
        return conn;
    } catch (SQLException e) {
        throw new GetConnectionException("Could not get JDBC Connection", e);
    }
}