-->
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: Hibernate applies select query before inserting an Object
PostPosted: Fri Dec 12, 2008 1:13 am 
Newbie

Joined: Thu Dec 04, 2008 7:00 am
Posts: 4
Hi

Hibernate applies select query before inserting an Object into DB.

I.e.

I have an object of ClassC, which has list of ClassD objects.
Then I have an Object of ClassA and Object of ClassB, which share common object ClassC,

Now I have two problem
1) First when I store an Object of ClassC, so along with inserting instance of ClassC hibernate will also insert all objects of classd which are in list of classc, but before it insert these objects it applies select for classd table which kills the performance.

2) Now I am going to insert an object of ClassB and ClassA, which share common object of ClassC and we inserted it before even though it applies select query for classc while storing objects of classb and classa, so it also cause to pour performance.

So can any one help me in telling hibernate that classc instance is already inserted so no need to apply select query?
Or any other ways through which hibernate does not apply select query.

Note: I have already tried with second level cache but it does not help me in above.


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.