This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
The first "insertUsers" method encompasses the call to "jdbcTemplate.batchUpdate" within the TransactionTemplate but in
case of second "insertUsers" method, the call to the method is encompassed within the TransactionTemplate as can be seen
in the "main" method.
In case of any exception, the first "insertUsers" method rollsback all INSERTS while second "insertUsers" method
does not i.e. all INSERTS done before exception get commited.
I am using JDBCTemplate.batchUpdate(String sql, BatchPreparedStatementSetter setter) to perform a batch INSERT operation in Oracle 11g database.
I believe the connection has 'autocommit' set to true by default.
Could you please advice the reason for the 2 behaviours?
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Use of TransactionTemplate with autocommit on in Spring 2.5 (JDK 1.4)