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:
You can't, simply run your code within a transaction, Spring will automatically disable auto-commit for you. The easiest (at least to set-up) way to run a piece of code in a transaction in Spring is to use TransactionTemplate:
TransactionTemplate template = new TransactionTemplate(txManager);
template.execute(new TransactionCallback