Note that the single problem with this is that objects that _aren't_
actually being deleted (and that might be referenced by the application)
are suddenly evicted - and any subsequent modifications are lost.

Actually, the disable-when-instances-are-loaded option can almost be used
to emulate the evict-all-instances option. The user just has to manually
evict any instances that might cause mass update to be disabled.

P.S. I just realised that this is more than a 2 hr job. I was hoping to
reuse the existing HQL translation code completely. Unfortunately,
databases dont like:

delete from foos f where f.count > 10

You aren't allowed to use aliases in a DELETE. I wasn't really aware of
that (makes sense).

But anyway, its still certainly doable.



|---------+---------------------------->
|         |           "Domagoj         |
|         |           Jugovich"        |
|         |           <[EMAIL PROTECTED]>|
|         |                            |
|         |           04/08/03 05:23 PM|
|         |                            |
|---------+---------------------------->
  
>------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                    
                                          |
  |       To:       <[EMAIL PROTECTED]>                                                
                                  |
  |       cc:                                                                          
                                          |
  |       Subject:  Re: [Hibernate] Mass Deletes                                       
                                          |
  
>------------------------------------------------------------------------------------------------------------------------------|




and fourth :    issue a delete and flush all cache

but disable-when-instances-are-loaded  is OK, when we want a mass delete we
must take care that we don't have nothing loaded of that class, it is more
logical because this mass-delete feature is primarily for speed/performance
so we should tradeoff everithing , lifecycle, caching, if we want
lifecacyle
etc.. we do normal deletion. But how will be the choosing implemented (mass
or normal delete) ?







----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 04, 2003 5:36 AM
Subject: [Hibernate] Mass Deletes


> Many users have asked for
>
>     session.delete("from Foo foo where foo.count=0");
>
> to issue a single SQL DELETE. This is certainly not possible for objects
> with collections or cascades  (though it might not matter if we ignore
> Lifecycle callback; not sure). For other classes it is conceptually
> possible.
>
> Now, this is really quite easy to implement - it would take me about  1-2
> hours to do it.
>
> But my big problem is: how do we know which _loaded_ objects were
deleted?
> I don't think there is any good way to do this. All we get back from
DELETE
> is a row count.
>
>   * Do we issue a SELECT beforehand, to fetch the ids ..... and then
issue
> the delete?
>   * Do we just disable mass delete for classes which have loaded
instances?
>   * Is it simply not worth it?
>
> The select-then-delete option doesn't seem particularly better than the
> current situation when JDBC batch updates are enabled. The
> disable-when-instances-are-loaded option looks like it would work, but
only
> for some very limited usecases (though it may work for the usecases we
are
> most interested in).
>
>
> Thoughts?
>
>
> **********************************************************************
> Any personal or sensitive information contained in this email and
> attachments must be handled in accordance with the Victorian Information
> Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988
> (Commonwealth), as applicable.
>
> This email, including all attachments, is confidential.  If you are not
the
> intended recipient, you must not disclose, distribute, copy or use the
> information contained in this email or attachments.  Any confidentiality
or
> privilege is not waived or lost because this email has been sent to you
in
> error.  If you have received it in error, please let us know by reply
> email, delete it from your system and destroy any copies.
> **********************************************************************
>
>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
>
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
> _______________________________________________
> hibernate-devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/hibernate-devel
>






**********************************************************************
Any personal or sensitive information contained in this email and
attachments must be handled in accordance with the Victorian Information
Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988
(Commonwealth), as applicable.

This email, including all attachments, is confidential.  If you are not the
intended recipient, you must not disclose, distribute, copy or use the
information contained in this email or attachments.  Any confidentiality or
privilege is not waived or lost because this email has been sent to you in
error.  If you have received it in error, please let us know by reply
email, delete it from your system and destroy any copies.
**********************************************************************






-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to