Showing posts with label oracle. Show all posts
Showing posts with label oracle. Show all posts

Thursday, July 18, 2013

Exception: OptimisticLockingFailureException, Spring Batch 2.1.7

Probably this is not a non common exception on Spring Batch 2.1.7, if you are doing UnitTest this error will not appear, but if you are going to deploy your application on WebLogic 10g, spring batch breaks on ItemWriter, so the first thought is something like having break with a database transaction, well this is the answer:

If you have a configuration like this:


This will be break with the following exception on your Weblogic:



This is because some id and version are having a bad update in your spring batch table, to fix this problem you will have to create a Database with the full tables defined in your spring batch jar file:


If you unzip the jar file you will find a 'schema-drop-'%DATABASE%'.sql'  in "org/springframework/batch/core", you have to execute that script and re-deploy your application context with the folling configuration:


Finally, this error will be fixed.

Best Regards,