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

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

Introduction

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

Prototype

TransactionIsolationLevel READ_UNCOMMITTED

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

Click Source Link

Usage

From source file:gw.jacoco.sqlreport.SQLReportGenerator.java

License:Open Source License

private void createReport(final IBundleCoverage bundleCoverage) throws IOException {
    sessionFactory = initializeIBatis(dbEnv);
    SqlSession session = null;/*from   w w  w.j a  va 2  s.co  m*/

    try {
        // Create a concrete report visitor based on some supplied
        // configuration. In this case we use the defaults
        final SQLFormatter sqlFormatter = new SQLFormatter();
        session = sessionFactory.openSession(TransactionIsolationLevel.READ_UNCOMMITTED);
        final IReportVisitor visitor = sqlFormatter.createVisitor(session, branchName, changelist, suiteName,
                suiteRunDate);

        // Initialize the report with all of the execution and session
        // information. At this point the report doesn't know about the
        // structure of the report being created
        visitor.visitInfo(sessionInfoStore.getInfos(), executionDataStore.getContents());

        for (File sourceDirectory : sourceDirectories) {
            // Populate the report structure with the bundle coverage information.
            // Call visitGroup if you need groups in your report.
            visitor.visitBundle(bundleCoverage, new DirectorySourceFileLocator(sourceDirectory, "utf-8", 4));
        }

        if (sourceDirectories.isEmpty()) {
            visitor.visitBundle(bundleCoverage, null);
        }

        // Signal end of structure information to allow report to write all
        // information out
        visitor.visitEnd();
    } finally {
        if (session != null) {
            session.commit();
            session.close();
        }
    }
}