title: Spring jdbc programmatic transaction for batch insert of items from file
body: <p>I am revamping a dataloader that reads from flat file and batchinsert using jdbctemplate for every 500 items. I am using java executor fixed thread pool  that submits tasks, which does reading each file and batchupdate. For example when reading first file, if it fails during 3rd batchinsert ,all the previous batchinsert for this file needs to be rollbacked.  The task should continue with next file and create a new transaction for insert.  I needed a code that can do this .  Currently I am using transactiontemplate and wrapping the batchinsert code inside <code>doInTransactionwithoutcallback</code>and during exception in catch block calling transaction status.setrollbackonly.  But I need a code which can create new transaction for next file irrespective of whether last file failed or succeded.setting propagation to requires new solves it?</p>