Currently I\'m setting autocommit to false in spring through adding a property to a datasource bean id like below :
In some case you could just add @Transactional in the method, e.g. After some batch insert, execute commit at last.
@Transactional