You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Gary <gl...@yahoo.com> on 2004/05/05 18:02:33 UTC

Should Exception be Thrown on Delete if Object Doesn't Exist?

Should an exception be thrown when a delete is
requested on an object that doesn't exist in the
database?  I think so, but the code currently does
nothing.  Ideas and comments?

I see the following in JdbcAccessImpl.executeDelete():

// @todo: clearify semantics
            // thma: the following check is not
secure. The object could be deleted *or* changed.
            // if it was deleted it makes no sense to
throw an OL exception.
            // does is make sense to throw an OL
exception if the object was changed?
            if (stmt.executeUpdate() == 0 &&
cld.isLocking()) //BRJ
            {
                //throw new
OptimisticLockException("Object has been modified by
someone else", obj);
            }

Thanks, Gary


	
		
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Should Exception be Thrown on Delete if Object Doesn't Exist?

Posted by Gary <gl...@yahoo.com>.
Great, thanks.  I'm on RC6.  Sorry for not checking
CVS before posting.

Gary

--- Jakob Braeuchi <jb...@gmx.ch> wrote:
> hi gary,
> 
> i fixed this one recently.
> 
> jakob
> 
> Gary wrote:
> 
> > Should an exception be thrown when a delete is
> > requested on an object that doesn't exist in the
> > database?  I think so, but the code currently does
> > nothing.  Ideas and comments?
> > 
> > I see the following in
> JdbcAccessImpl.executeDelete():
> > 
> > // @todo: clearify semantics
> >             // thma: the following check is not
> > secure. The object could be deleted *or* changed.
> >             // if it was deleted it makes no sense
> to
> > throw an OL exception.
> >             // does is make sense to throw an OL
> > exception if the object was changed?
> >             if (stmt.executeUpdate() == 0 &&
> > cld.isLocking()) //BRJ
> >             {
> >                 //throw new
> > OptimisticLockException("Object has been modified
> by
> > someone else", obj);
> >             }
> > 
> > Thanks, Gary
> > 
> > 
> > 	
> > 		
> > __________________________________
> > Do you Yahoo!?
> > Win a $20,000 Career Makeover at Yahoo! HotJobs  
> >
> http://hotjobs.sweepstakes.yahoo.com/careermakeover 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> ojb-user-unsubscribe@db.apache.org
> > For additional commands, e-mail:
> ojb-user-help@db.apache.org
> > 
> > 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail:
> ojb-user-help@db.apache.org
> 



	
		
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Should Exception be Thrown on Delete if Object Doesn't Exist?

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi gary,

i fixed this one recently.

jakob

Gary wrote:

> Should an exception be thrown when a delete is
> requested on an object that doesn't exist in the
> database?  I think so, but the code currently does
> nothing.  Ideas and comments?
> 
> I see the following in JdbcAccessImpl.executeDelete():
> 
> // @todo: clearify semantics
>             // thma: the following check is not
> secure. The object could be deleted *or* changed.
>             // if it was deleted it makes no sense to
> throw an OL exception.
>             // does is make sense to throw an OL
> exception if the object was changed?
>             if (stmt.executeUpdate() == 0 &&
> cld.isLocking()) //BRJ
>             {
>                 //throw new
> OptimisticLockException("Object has been modified by
> someone else", obj);
>             }
> 
> Thanks, Gary
> 
> 
> 	
> 		
> __________________________________
> Do you Yahoo!?
> Win a $20,000 Career Makeover at Yahoo! HotJobs  
> http://hotjobs.sweepstakes.yahoo.com/careermakeover 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org