title: Slow closing SqlSession in myBatis with spring
body: <p>I have a trouble with myBatis. I see serious performance degradation on transactional methods (And even non transactional) after enabling transaction manager in spring:</p>
  
  <pre><code>&lt;tx:annotation-driven transaction-manager="transactionManager"/&gt;
  
  &lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"&gt;
      &lt;property name="url" value="${database.url}"/&gt;
      &lt;property name="driverClassName" value="${database.driver}" /&gt;
      &lt;property name="username" value="${database.user}" /&gt;
      &lt;property name="password" value="${database.password}" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"&gt;
      &lt;property name="dataSource" ref="dataSource" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"&gt;
      &lt;property name="dataSource" ref="dataSource" /&gt;
      &lt;property name="typeAliasesPackage" value="com.company.model" /&gt;
  &lt;/bean&gt;
  
  &lt;bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"&gt;
      &lt;property name="basePackage" value="com.company.mapper" /&gt;
  
  &lt;/bean&gt;
  </code></pre>
  
  <p>Log for example, as you can see there are about 150 milliseconds between closing and starting new transaction.</p>
  
  <pre><code>09:28:58.134 [http-bio-9081-exec-12] DEBUG o.m.s.SqlSessionUtils - Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@cf80c3]
  09:28:58.297 [http-bio-9081-exec-3] DEBUG o.m.s.SqlSessionUtils - Creating a new SqlSession
  </code></pre>
  
  <p>Database: Oracle 11.2
  Thanks.</p>