db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oyvind.Bakk...@Sun.COM
Subject Re: SQLExceptions and OutOfMemoryExceptions
Date Wed, 23 Nov 2005 15:02:21 GMT
Daniel John Debrunner wrote:
> Oyvind.Bakksjo@Sun.COM wrote:
>>Lance J. Andersen wrote:
>>>I am not fond of a Singleton of a SQLException but that is just me.
>>You would at least need to have one per thread.
> Why? If I have a singleton as a static and never modify it, I can safely
> throw it in multiple threads. It will have the fixed meangingless stack
> trace, but this to handle a special case.

The stack trace isn't created when the Exception object is constructed, 
it's created when it's thrown. If you throw the same exception object 
from multiple threads, they will interfer with each other in 
unpredictable ways.

Oyvind Bakksjo
Sun Microsystems, Database Technology Group
Trondheim, Norway

View raw message