scwanglijun / ehcache-spring-annotations

Automatically exported from code.google.com/p/ehcache-spring-annotations
0 stars 1 forks source link

cached exceptions may have confusing stack traces #94

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Enable an exceptionCacheName="..." in a @Cacheable

2. Have said @Cacheable throw an exception (in some unique call stack)

3. Call the same method again with the same parameters (but from a different 
call stack) 

The exception thrown will contain the stack trace of the invocation that first 
cached it. It might be wildly different in other invocations. 

The only "solution" I can think of is to serialize/deserialize the cached 
exception (to produce a clone of sorts) and then "fix" the stack trace on the 
clone before throwing it. That operation would come at an expense so this 
should perhaps be optional behavior. 

Original issue reported on code.google.com by tim...@gmail.com on 23 Mar 2012 at 12:04