I'm somewhat unclear on the spec regarding session migration in a distributed environment. As I read the spec, objects stored as session attributes may be required to implement Serializable, but not necessarily. Is that correct? The spec says that the container must accept all Serializables but that it may use its own serializing facility. If I read it correctly, that's not a very good way to do things. That should be nailed down one way or the other.
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Session attributes should always be Serializable in a distributed environment to meet the spec. However, containers are not required to use serialization at all. They could use some other mechanism but they might use serialization. Remember, web components are supposed to be portable accross containers. If you deploy your application to a container that doesn't use serialization and you have a session attribute that is not serializable, you may be fine. However, if you move that same application to a container that does use serialization, it will blow up when it tries to migrate your session attributes. The specs just establish a baseline but they don't get too specific so that container vendors can compete based upon their innovative implementations of the specs.
The specs just establish a baseline but they don't get too specific so that container vendors can compete based upon their innovative implementations of the specs. Your explanation is as I interpreted the spec. But giving the vendors to much rope is what damages portability. It seems IBM goes out of their way to stay on the edges of the spec to keep their WebSphere customers, I'm sure the other vendors do the same. For J2EE apps to be truly, write once, run anywhere, there should not be gaping loopholes like this.
Joined: Sep 25, 2003
It is the responsibility of the developer to know what features they use are in the spec and which ones are proprietary features. Portability is not negatively affected by an implementation of the spec. If you choose to use the proprietary features of a container, you yourself are limiting your own portability.