I'm struggling with a crash in our app and I believe I have understood what is wrong.
- Using Tomcat - Marking a Cayenne Data Object as a persistent Tapestry property will cause it to be put into the servlet session - Tomcat will then(whenever it feels like it, it seems) serialize my Cayenne Data Object. - Serializing a Cayenne Data Object works fine as a Cayenne Data Object implements Serializable, except that the DataContext is nulled out. - Depending on whether or not Tomcat decided to serialize and deserialize the Cayenne Data Object, I may or may not get an NPE when trying to do method no the Cayenne Data Object's DataContext (via getDataContext()) My Servlet superpowers are not quite sufficient to determine the solution, but a couple of things come to mind: - Create a non-serializeable wrapper object which has a reference to the Cayenne Data Object. This will stop Tomcat from trying to serialize & deserialize my Cayenne Data Objects - Somehow configure Tomcat not to try to serialize Cayenne Data Objects If my understanding is correct, then this is *nasty*. The problem is that this problem does not exist on Jetty(which is our development environment) and only on certain Tomcat servers depending on configuration. I prefer being broken all the time instead of sometimes. Clustring is an insane overkill for our purposes so I know pffft about clustering issues. -- Øyvind Harboe http://www.zylin.com
