[VOTE] Add convenience methods deleteObjectById
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache JDO Project > [VOTE] Add convenience methods deleteObjectById




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    [VOTE] Add convenience methods deleteObjectById  
Craig L Russell


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-09-07 06:11 AM






[ Post a follow-up to this message ]



    Re: [VOTE] Add convenience methods deleteObjectById  
Craig L Russell


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-09-07 06:11 AM






[ Post a follow-up to this message ]



    Re: [VOTE] Add convenience methods deleteObjectById  
Matthew T. Adams


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-13-07 06:11 PM

[ x ] Proposal C (do nothing)

If deleteByObjectId(Object oid) is nothing more than getting the object by i
d with validate == false and then calling deletePersistent, then the deleteB
yObjectIid methods are of little value.

----- Original Message ----
From: Craig L Russell <Craig.Russell@sun.com>
Cc: Apache JDO project <jdo-dev@db.apache.org>; JDO Expert Group <jdo-expert
s-ext@sun.com>
Sent: Thursday, March 8, 2007 7:15:34 PM
Subject: Re: [VOTE] Add convenience methods deleteObjectById

Although I like the idea, the details trouble me. We need to specify the beh
avior incase the instance exists or not, and whether the instance is able to
 be deleted (e.g. there is a foreign key violation or some locking issue). A
nother issue is whether the delete is required to be immediate or delayed un
til commit.

It's possible for the application to do a getObjectsById with the validate p
arameter set to the developer's choice and then to delete theinstances retur
ned. With validate set to false, this would be as efficientas the proposed d
eleteObjectsById. So the value for the developer is not as compelling as the
 other APIs that we've added recently.


Craig

On Mar 8, 2007, at 7:08 PM, Craig L Russell wrote:

Please vote for 

[ ] Proposal A void deleteObjectById
[ ] Proposal B long deleteObjectById
[ ] Proposal C (do nothing)


This vote will close Monday 12-Mar-2007.


Please see https://issues.apache.org/jira/browse/JDO-469

I'd like to discuss adding the methods to PersistenceManager:

Both Proposals A and B follow the basic rules of deletePersistent, with diff
erences if the object identified by the oid is not persistent.


Proposal A 


proposed by Matthew Adams:
void deleteObjectById(Class cls, Object key); void deleteObjectById(Object o
id); 
void deleteObjectsById(Collection oids); 
void deleteObjectsById(Object[] oids); 


With proposal A, any object that cannot be deleted would throw an exception 
similar to what is done with deletePersistent.


Proposal B


I think we might want to allow for the possibility that it was not possible 
to delete all the requested items, so add a return value with the number of 
objects actually deleted:
long deleteObjectById(Class cls, Object key); longdeleteObjectById(Object oi
d); 
long deleteObjectsById(Collection oids); 
long deleteObjectsById(Object[ ] oids); 


Proposal C


do nothing


Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!
  






 Craig Russell
 Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
 408 276-5638 mailto:Craig.Russell@sun.com
 P.S. A good JDO? O, Gasp!
  











[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 04:45 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register