Announcement Announcement Module
Collapse
No announcement yet.
Stateful vs Stateless Hibernate session Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Stateful vs Stateless Hibernate session

    Hi,

    I'm using Hibernate for data access in my batch job. I understand using hibernate stateful session is not feasible in batch application and hence HibernateCursorItemReader is used for reading input data using stateless session. But does that mean we need to use stateless session even for saving(insert, update) the output data to database. If, yes how should we take care of the transaction management in our DAO using stateless session. I guess spring doesn't provide support for stateless session through HibernateDaoSupport.

    Please clarify me on this.

    Regards,
    Jonathan

  • #2
    You can use a stateful session in a dao as your writer, but you have to be careful about how you flush, which is described in the reference documentation: http://static.springframework.org/sp...e.html#d0e2581

    Comment


    • #3
      Lucas, Thanks for replying..

      Does that mean we cannot use stateless session for operations like save/update in spring batch?

      Comment

      Working...
      X