Quote:
Actually i have to save around 20000 objects at the same time. I can categorize them on some basis (say into 10 lots). So, I thought to save them parallelly to improve performance.
That's a very tricky question and it really depends what database you are talking about. I suggest that you seek advice from a DBA. If you ask me I would drop all indexes if nobody else is looking at the database. From the Java side make sure you have the maximum bandwidth between your computer and the db machine (sometimes you can tweak packet size and so) and tweaking batch size is also good. I don't suggest you call the flush itself but seriously I might not be the right person to comment on this since I never did bulk loading and stuff. Hmm, one another thing I remember is reducing locking during updates. In some dbs like SQL Server you can tweak this to a great deal (a row lock per update in preferable).
Quote:
So, i have to save from the root level of the tree and hence i cannot even say clear session in-between. I was wondering whether Hibernate itself can detect the relationships and can clear the session on setting some property xyz..
You lost me here. Say again.
Farzad-