In a Spring-based application, I have a session-scoped bean that implements DisposableBean interface. Are there any circumstances when its destroy method will not be called on the session expiration?

The application uses Spring version: 2.0.8 and runs on WebSphere 6.1.

有帮助吗?

解决方案

Apparently, in WebSphere Network Deployment a DisposableBean may not be correctly destroyed. In a clustered environment the application server creates a copy of a session bean (with serialization/deserialization). Then, when session invalidates, it calls the destroy not on the original bean but on its copy. As a result, the destroy method on the original bean is never called in this case.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top