-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: HowTo reduce number of update statements
PostPosted: Fri Aug 20, 2004 11:48 am 
Newbie

Joined: Thu Apr 08, 2004 7:17 am
Posts: 10
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


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 20, 2004 3:33 pm 
Newbie

Joined: Wed Aug 18, 2004 8:44 am
Posts: 12
Try reading this

http://www.hibernate.org/hib_docs/refer ... ollections

it has some tips


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.