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: NHibernate DELETE STATEMENT
PostPosted: Sun Nov 05, 2006 10:26 am 
Newbie

Joined: Sun Nov 05, 2006 10:19 am
Posts: 13
Hi,

I'm using nhibernate and I'm trying to delete from a single query many rows in the database (around 3.000.000)

I'm using the next statement:

------------------------------------------------------------------------
Code:
tx = session.BeginTransaction();
session.Delete("from item c where c.ItemType= ?", type, NHibernateUtil.Int32);
tx.Commit();

------------------------------------------------------------------------


The idea is that is working OK. But looking in the RAM manager I see that it is increasing very very much. I guess that the idea behind this delete is loading the all objects in memory. There is another way to perform a simple delete such as from one shoot:

DELETE FROM items WHERE ItemType = 3;

Thx in advane and best regards....


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.