-->
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.  [ 4 posts ] 
Author Message
 Post subject: Fast Delete
PostPosted: Tue Jul 12, 2005 3:31 pm 
Is there a way to do a fast delete? One where nhibernate knows not to load the objects first? I'd like nhibernate to empty its cache and and trust me that my call to truncate a large audit table does not affect dependancies. I'd love to keep my O-R languange and not have to revert to a SQL snippet.

I think the answer is a firm NO...but I had to ask as I have a delete that is taking 2 minutes plus.


Top
  
 
 Post subject:
PostPosted: Wed Jul 13, 2005 6:06 pm 
Regular
Regular

Joined: Mon May 16, 2005 2:15 pm
Posts: 59
I haven't tried this, but I wonder if it would be possible to create an object of AuditDelete and a mapping with the audit date as the key field.

Then create the Audit Delete object and populate the id field with the audit date that you want to delete. Then delete this object.

The SQL generate should be:

DELETE FROM AuditTable WHERE AuditDate = @date

This will delete all the audit records from that date. You will still need to send a statement for each date, but it should be faster than one for each audit record.

BOb


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 15, 2005 4:09 am 
Like the idea unfortunately the date is a date time (with seconds) so it would'nt work for my situation.[/i]


Top
  
 
 Post subject:
PostPosted: Fri Jul 15, 2005 11:59 am 
Newbie

Joined: Sat Jul 02, 2005 12:42 pm
Posts: 11
Location: Manchester, UK
I think this is one of the features that Hibernate 3.0 has. It would be nice to have it in NHibernate as well :D

_________________
- Simon

http://www.intesoft.net/


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

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.