On Fri, Jul 15, 2005 at 08:52:53AM +0200, Jacek Laskowski wrote: > [EMAIL PROTECTED] wrote: > >FYI, The serialization problem should be fixed in the Derby 10.1 release > >which should be out in the next few days hopefully. > > Derby exceptions are just an example. I'd like to know who should take > care of the issue, the container or a bean provider?
IMHO, neither. I've been meaning to add functionality to the server that deals with all sorts of issues we've had with serializing exceptions. More often than things not serializing are things not deserializing because a required class is not present in the client vm. One of the basic concepts I've thought is to basically wrap the exeption and a string version of the exception in an externalizable object and write that to the stream. A failure to serialize/deserialize something inside an externalizable object doesn't cause the stream to become corrupted as the externalizable object itself is written in it's own special buffer by the ObjectOutputStream. So you would write (or read) the string version first, then make an honest attempt to write (or read) the actual excption instance. Now all that is beautiful, except that it is a little hard to make an identically looking exception instance to throw the client. > Also, I'm wondering whether or not SQLExceptions are of any value at > a client side? I would rather suggest using real application > exceptions (created by the bean provider) which would only carry > information that a given operation could not be executed properly. If I remember from the test case uses SQLException as an application exception. > What about the property - openejb.includeStackTrace or > openejb.sendStackTrace - to not send a stack trace, but only a > toString() representation of it. It may be of help in some situations > where a bean is not properly developed wrt exception handling. I think > people would like a property that would turn them off. I don't think we really need a flag for something like this as I can't imagine a scenario where people would want the behavior we have now if there was something better. -David
