Results 1 to 3 of 3

Thread: Stateful vs Stateless Hibernate session

  1. #1
    Join Date
    Sep 2008
    Posts
    20

    Default 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. #2
    Join Date
    Dec 2006
    Posts
    1,061

    Default

    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

  3. #3
    Join Date
    Sep 2008
    Posts
    20

    Default

    Lucas, Thanks for replying..

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

Posting Permissions

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