S
Simon
Hi,
I have a @PreRemove method in an entity bean which frees some resources.
What is the preferred way to signal exceptions occurring in this method?
If an exception occurs, I would like to have the entire remove operation
rolled back.
I have tried to throw a regular exception, which, e.g., Glassfish does
not like. Apparently, it catches it and then tries to cast it to Error,
which certainly fails. This results in an extremely obscure log message
(a ClassCastException to Error), and the original exception is lost and
not logged anywhere. Am I supposed to throw Errors? Maybe RuntimeExceptions?
Any help is appreciated.
Cheers,
Simon
I have a @PreRemove method in an entity bean which frees some resources.
What is the preferred way to signal exceptions occurring in this method?
If an exception occurs, I would like to have the entire remove operation
rolled back.
I have tried to throw a regular exception, which, e.g., Glassfish does
not like. Apparently, it catches it and then tries to cast it to Error,
which certainly fails. This results in an extremely obscure log message
(a ClassCastException to Error), and the original exception is lost and
not logged anywhere. Am I supposed to throw Errors? Maybe RuntimeExceptions?
Any help is appreciated.
Cheers,
Simon