-->
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: performance of multiple updates at once
PostPosted: Thu Feb 17, 2005 2:24 pm 
Newbie

Joined: Thu Feb 17, 2005 2:13 pm
Posts: 1
Hello,

my question is about the performance of mass-updates, and let me start the story:
from time to time i have to update 1000 records and change only one field (data replication). this led to 1000-update statements at once on the databank that made our dbadmin unhappy. So i would like to ask if :
1. is there any chance to make hibernate translate this in an one and only update like:
update table items it
set it.replicationStatusid = 1
where it.id IN (1, 2, .. 1000)

2. what do I have to do to have hibernate updating only the modified column ?
3. is this a point where i would better write hand-coded SQL ? what happens then with the records that are allready in hibernate-cache ?

Thanks,
adrian

[b]Hibernate version: 2.0[/b]

[b]Name and version of the database you are using:[/b]
mysql 4.0.18 :(
[b]The generated SQL (show_sql=true):[/b]
update TaNBOitem set wwsItemId=875619, companyId=18, commodityGroupId='100000001800000000080000000052000000560000000000-
100000000-100000000-1', itemId=306460, description1='YSL OPIUM', description2='EDT VAPO 100 ML', replicationStatusId=0,
replicationStatusIdFidibus=0, completeReplicationStatusId=1, lastChange='2005-02-15 11:38:50', itemStatus=0, expirationD
ate=null where nboItemId='00000000180000875619';
# User@Host: eai[eai] @ localhost [127.0.0.1]
# Query_time: 51 Lock_time: 0 Rows_sent: 0 Rows_examined: 0
update TaNBOitem set wwsItemId=919643, companyId=18, commodityGroupId='100000001800000000030000000001000000000200000000-
100000000-100000000-1', itemId=497071, description1='SA*AMERICAN BALLADS', description2='TAKE THE HIGHWAY +3+', repl
icationStatusId=1, replicationStatusIdFidibus=0, completeReplicationStatusId=1, lastChange='2005-02-08 16:18:04', itemSt
atus=1, expirationDate='2001-08-23 00:00:00' where nboItemId='00000000180000919643';

...


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.