How can I config to turn off autocommit in Spring + JDBC?

前端 未结 3 1759
礼貌的吻别
礼貌的吻别 2020-12-14 03:41

I am using Spring with JDBC and found that it is autocommit.

How can I config to turn it off in spring-servlet.xml?

This is my current configuration:

3条回答
  •  时光说笑
    2020-12-14 04:14

    Try defaultAutoCommit property. Code would look like this:

    
    

    Look at javadoc: http://commons.apache.org/dbcp/apidocs/org/apache/commons/dbcp/BasicDataSource.html#defaultAutoCommit

提交回复
热议问题