Hello,
I have some sugegstions, but you have to decide on your task, which one will fit best. First of all, when you do batch processing you will soon encounter problems with the actual Session. My experiences are, that hibernate works quite performant to a certain point of data and then the performance crashes (or you will get memory problems).
So if you use a standard session you will need to flush and evict objects regulary. There is a guid for batch processing in the manual discussing this step.
If you can disclaim a normal session and do not need the caching algorithm behind it, you can use a StatelessSession. This will give you no real advantage in terms of speed, but you will not have to care about the session producing memory problems (because the entities will not be attached). I have done a batch processing just some time ago and it worked very good.
|