Results 1 to 3 of 3

Thread: Batch and hibernate

  1. #1
    Join Date
    Jun 2012
    Posts
    14

    Default Batch and hibernate

    Hi ,

    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
    HibernateCursorItemReader ?

    can I have the forum view on the above ? and what is the best practices ?

    thanks

  2. #2
    Join Date
    Aug 2006
    Location
    Arequipa-Peru / South America
    Posts
    2,796

    Default

    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

    Blog


    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

  3. #3
    Join Date
    Jun 2012
    Posts
    14

    Default

    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 ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •