-->
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: Optimize db hits by way of batch insert
PostPosted: Wed Apr 16, 2008 11:14 pm 
Regular
Regular

Joined: Sun Apr 13, 2008 3:04 am
Posts: 71
Location: Bangalore
Hi,

When I use Session.save(MyCustomObject).. Hibernate is internally issuing 3 insert statements as below.

Is there a way to tell hibernate to use single insert or batch insert so that it need not make 3 db hits..

I am hoping that, this should be possible by proper annotation to the custome object.

Regards,
Nagendra

Parameter:xmlRequest=<RegisterRequest name='rja' loginID='nag1' password='nag' e
mail='nag@nag.com'><Phone number='123213'/></RegisterRequest>


Hibernate:
/* criteria query */ select
this_.loginID as y0_
from
TBL_USERS this_
where
lower(this_.loginID) like ?
Hibernate:
/* insert com.tejasoft.dialer.model.bdo.User
*/ insert
into
TBL_USERS
(name, password, loginID, email, zip)
values
(?, ?, ?, ?, ?)
Hibernate:
/* insert com.tejasoft.dialer.model.bdo.Phone
*/ insert
into
TBL_PHONES
(number, country, countryCode)
values
(?, ?, ?)
Hibernate:
/* insert com.tejasoft.dialer.model.bdo.Relation
*/ insert
into
TBL_RELATIONS
(name, phone_pk, relation, tezzd, user_pk)
values
(?, ?, ?, ?, ?)

_________________
Raja Nagendra Kumar,
C.T.O
http://www.tejasoft.com
TejaSoft - Specialists in Code Audit, Unit Testing and Merciless Re-factoring - Engineering Crisis Turnaround Experts


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.