Issue Details (XML | Word | Printable)

Key: BATCH-150
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Lucas Ward
Reporter: Lucas Ward
Votes: 0
Watchers: 1
Operations

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

Create HibernateInputSource

Created: 01/Oct/07 10:03 AM   Updated: 04/Mar/08 11:39 AM
Component/s: Infrastructure
Affects Version/s: 1.0-m2
Fix Version/s: 1.0-m3
Security Level: Public (Public Issues)

Time Tracking:
Not Specified

File Attachments: 1. Text File hibernate-infrastructure.patch (89 kB)
2. Text File hibernate-samples.patch (28 kB)



 Description  « Hide
Create a HibernateInputSource, keeping in mind Hibernate's recommendations for running in a Batch application:

http://www.hibernate.org/hib_docs/reference/en/html/batch.html



 All   Comments   Work Log   Change History   FishEye   Builds      Sort Order: Ascending order - Click to sort in descending order
Robert Kasanicky added a comment - 03/Oct/07 07:29 AM
Attached patches contain:

- hibernate input source based on stateless session and iteration over scrollable resultset
- unified tests for all sql input sources (one common superclass contains testcases)
- necessary refactorings to SingleKeyDrivingQuery (new functionality added) and SqlCursor (minor tweaks) input sources
- sample job using hibernate input source for input and hibernate dao for output

Dave Syer added a comment - 04/Oct/07 10:20 AM
I'm not so sure a stateless session is the best approach - you lose the benefit of 1st level cache. Needs to be tested against a realistic complex data model (with reference data).

Wayne Lund added a comment - 04/Oct/07 06:23 PM
I don't believe there's a lot of benefit to 1st level cache in batch mode with Hibernate. It would be interesting to have a hibernate developer comment. Reference Data is typically stored in 2nd level cache but I wonder if it would get there without the connection through 1st level cache. I agree that in batch you do tend to initialize reference data that will be accessed throughout the batch job. I would be willing to manually populate level 2 cache to have the benefits of bypassing managed objects in batch.

Lucas Ward added a comment - 15/Oct/07 12:52 AM
A hibernate input source has been added, using the patch added to BATCH-144.

Paul Benedict added a comment - 04/Mar/08 11:08 AM
Is this related to the work on SPR-2495?

Dave Syer added a comment - 04/Mar/08 11:39 AM
Possibly - except that SPR-2495 is asking about updates and inserts and this is focused on input. The implementation is now called HibernateCursorItemReader if you are interested.