-->
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.  [ 1 post ] 
Author Message
 Post subject: Number of queries generated by Hibernate during insert issue
PostPosted: Mon Aug 04, 2008 2:18 am 
Newbie

Joined: Thu Jul 28, 2005 6:17 am
Posts: 14
Hibernate version: 3.2.6

Name and version of the database you are using: DB2 8.1

Hi,

I have a question regarding the number of queries Hibernate generates when doing an insert.

I have a Class A which has a collection of Class B. When i perform a getHibernateTemplate().save(instanceOfA) and the collection contains 1 instance of B i see the following queries generated:
1: select .. from Table-B
2: insert into Table-A
3: insert into Table-B
4: update Table-B

This is all done within 1 TX but i don't understand why Hibernate generates 4 seperate queries. The hbm.xml of Class A containts:
<set name="B" lazy="false" order-by="column-x asc" cascade="all">
..

Hope someone can clear this up for us.

Thanks,
Maarten


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

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.