|
From: Keith D. <ke...@in...> - 2005-06-03 05:37:08
|
I have a question about context hierarchy. I've run into a situation where I have a "delegating bean" (a singleton) in a parent context, making a lookup to a delegate instance in a flow-scoped child context. For transparency, the delegating bean and the delegate share the same bean name. This sounded fine to me, but I was greeted by a StackOverflowError within the delegating bean implementation when it tried to lookup the delegate. This happened because instead of getting the delegate, I got a reference back to the delegating object itself. In other words, when it queried the child context, the bean in the parent was returned, not the one in the child. I would've thought this to be the other way around - querying the child context would result in first its registry being checked, and then if no bean was found a call to the parent? Another, unreleated issue I am having is the ClasspathXmlApplicationContext and related implementations are not serializable. Is there any reason that this is not supported? In my case I have transactional state managed in a flow-scoped context - it'd be nice if I could serialize the entire context out for reconstruction of that state at a later point to facilitate server restarts, for example. Keith |