Issue Details (XML | Word | Printable)

Key: BATCH-203
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Dave Syer
Reporter: Lucas Ward
Votes: 0
Watchers: 0
Operations

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

HibernateDao incorrectly returns an existing job.

Created: 14/Nov/07 12:59 AM   Updated: 07/Aug/08 10:06 AM
Component/s: Core
Affects Version/s: 1.0-m2
Fix Version/s: 1.0-m3
Security Level: Public (Public Issues)

Time Tracking:
Not Specified

File Attachments: 1. File hibernate-testcase (1 kB)
2. Text File hibernate-testcase.txt (1 kB)



 Description  « Hide
If a job is created with a ScheduledJobIdentifier, and another job with a ScheduledJobIdentifier with the same name, but with other modified attributes, such as the job key, findJobs will return the existing job, rather than an empty list, as it should.

 All   Comments   Work Log   Change History   FishEye   Builds      Sort Order: Ascending order - Click to sort in descending order
Lucas Ward added a comment - 14/Nov/07 01:07 AM
I have attached a test case that breaks for the given scenario. I tried a few things to fix the issue, but it looks like it might be something in the mapping file? Perhaps the same approach that is used in the SqlJobDao should be used. Meaning that even simple identifiers should be turned into ScheduledIdentifiers, and each field should be used as a criteria in the search?

It's late, so I haven't tried a couple of my thoughts, but I'm attaching the test case, in case anyone has some other ideas.

Lucas Ward added a comment - 14/Nov/07 01:09 AM
renamed to add an extension, so it doesn't give windows users issues.

Dave Syer added a comment - 14/Nov/07 02:49 AM
Extracted EntityNameLocator from the EntityNameInterceptor - both the session factory's interceptor and the HibernateJobDao need to be injected with the locator so that the entity name can be determined from the JobIdentifer type.

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