Oct 25th, 2012, 10:59 AM
Batch and hibernate
I am Investigating the best practices on how to combine spring batch with hibernate ?
Is it better to use spring hibernate hybrid like HibernateCursorItemReader or separate dataservice and call it via item reader/writer adapter ?
I assume the transaction handling & commit interval will be tricky if we are going to use adapter ? compare to native
can I have the forum view on the above ? and what is the best practices ?
Oct 25th, 2012, 11:14 AM
For readers from a DB you have two options Cursor and Page
I suggest you read HibernatePagingItemReader<T>
In Spring Batch Reference documentation should exists material showing the differences between them
- Manuel Jordan
Kill Your Pride, Share Your Knowledge With All
The Fear Of The LORD Is The Beginning Of Knowledge, But Fools Despise Wisdom And Discipline. Proverbs 1:7
Technical Reviewer of Apress
- Pro SpringSource dm Server
- Spring Enterprise Recipes: A Problem-Solution Approach
- Spring Recipes: A Problem-Solution Approach, 2nd Edition
- Pro Spring Integration
- Pro Spring Batch
- Pro Spring 3
- Pro Spring MVC: With Web Flow
- Pro Spring Security
Oct 25th, 2012, 12:06 PM
So you prefer using hibernate item reader/writer instead of reader/writer adapter ? I am bit concern about transaction , if i create adapter, the hibernate data service will deal with transaction and spring batch cant control that transaction.. i assume the spring batch lose transaction control, is not better to use hibernatepaging or cursor ?