Issue Details (XML | Word | Printable)

Key: BATCH-94
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dave Syer
Reporter: Douglas C. Kaminsky
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Spring Batch

Sample jobs should not import "simple-container-definition.xml"

Created: 13/Aug/07 02:29 PM   Updated: 07/Aug/08 10:06 AM
Component/s: Samples
Affects Version/s: 1.0-m2
Fix Version/s: 1.0-m2
Security Level: Public (Public Issues)

Time Tracking:
Not Specified

Environment: Any


 Description  « Hide
When a sample job is executed, it imports the simple container definition. However, this should already be loaded by the batch launcher. Even with singleton scoped beans, this can cause spring to duplicate beans. This has no immediate consequence in the samples, but modeling my job after the samples caused my job to fail. Using an hsqldb-based in-memory datasource, I found that my job could not be initialized since it tried to load my schema definition twice and failed on the second time with SQLExceptions of the 'table already exists' variety.

 All   Comments   Work Log   Change History   FishEye   Builds      Sort Order: Ascending order - Click to sort in descending order
Dave Syer added a comment - 19/Aug/07 02:30 AM - edited
Clearly the samples configuration should not contain the import for simple-container-definition. But Spring does not allow singleton beans to be instantiated twice (by definition) so there is something else happening there. (Re-opened - not a duplicate.)

Douglas C. Kaminsky added a comment - 20/Aug/07 04:56 PM
The problem of duplication arises from the way I am using FactoryBean objects, it is not inherent to Spring Batch

Dave Syer added a comment - 21/Aug/07 08:54 AM
Removed from all samples (except adhocLoop)

Dave Syer added a comment - 07/Aug/08 10:06 AM
Assume closed as resolved and released