-
Oct 31st, 2008, 03:07 AM
#1
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
-
Nov 3rd, 2008, 11:41 AM
#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
-
Nov 4th, 2008, 05:53 AM
#3
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
-
Forum Rules