Hibernate version: 2.1.4
Hi,
we are migratiing an J2EE/CMP/CMT application to hibernate. The work is done for about 99%. Using hibernate is a little bit slower but much more reliable.
There is just one part that still makes problems. In this part we do the following in ONE session:
1. Delete many objects in different tables with some relations between them. We dont use hibernates cascade on delete methods.
2. Create a new set of objects.
3. Do some stuff an than again create many objects.
The problem is, that with J2EE/CMP/CMP on an Orion application server the stuff took about 1 minute, with hibernate it took more then 30 minutes.
Switching on output of SQL statements there are a lot of update statements. There are many update statements for the same object.
I played around with the flush-mode, but even if it is turned to NEVER all the time update statements are created. The documentation said, that queries for finding sometimes call flush.
I hoped, that there is a mode, where all the create, delete and update stuff is done in the session cache and only after commit the session cache is synchronized with the database. But I can't find the solution.
How can I minimize the number of insert and update statements?
Please, can somebody help me!?
Tanks in advance.
Alex
|