On 14 July 2010 08:02, abhishek jain <abhishek.netj...@gmail.com> wrote:

> I just realized that i am having in the Cart object which i save in
> session,
> references of datasource and message resources.
> This is creating the problem as they i believe are not serializable,
> Is there any way of overcoming them.
>
> They're not serializable for a good reason - you shouldn't really be
keeping references to system resources between requests.  As you've found
out, the session can be serialized at any time, and it may be deserialized a
long time later - potentially even after the application has been
restarted.  At this point, the references to datasources and message
resources may no longer be valid.

Why are you keeping references to the datasource and message resources in
the Cart now?  Can you re-think your design of the Cart so that it keeps
only serializable data between requests?

- Peter

Reply via email to