Read and respond to this message at: 
https://sourceforge.net/forum/message.php?msg_id=3323037
By: woodchuck5

hi Henner,

thx for the suggestion.  i never thought about making my own errors tag before.

you're right, the problem with making my own errors tag is parsing.

in a way, overriding the Event objects, in my case the DeleteEvent, with my
own Event object and just catching *all* SQLExceptions specifically when calling
doDelete() and then just returning the same custom error message whenever this
happens (ie. no parsing) is easier.  the only drawback is that i am assuming
all SQLExceptions thrown is going to be the "child record exists constraint"
error (ie. no cascade delete setup in database).  in such cases, i would return
to the user with something like "sorry, cannot delete selected record because
dependent child record(s) already exists".

do you think this is a bad idea?  i believe most of the time my assumption 
should
be correct.  however, if in fact the SQLException is caused by some other reason
(like database not working), i will still return the same error message even
though it is not the case...

i also thought about writing Interceptors and implementing the preDelete() 
function
to check if there are child records existing.  i could do something like "select
1 from employee where dept_no = ?" if i am deleting a record from the department
table.  but some of my parent tables have many child table dependencies.  if
there are 30 dependent tables, i don't want to execute 30 of such statements
just to check if the parent record is deletable.... right?

do you have any suggestions on handling this situation?  

thanks in advance!

woodchuck

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit: 
https://sourceforge.net/forum/unmonitor.php?forum_id=55830


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
DbForms Mailing List

http://www.wap-force.net/dbforms

Reply via email to