Re: Session Persistence (Database)
Re: Session Persistence (Database)
- Subject: Re: Session Persistence (Database)
- From: Mike Schrag <email@hidden>
- Date: Sun, 05 Jun 2011 11:36:32 -0400
i would really recommend not trying to serialize a session into the database directly ... there are a lot of aspects of this which will be a total nightmare (in-process transactions, stateful pages, session persistence frequency, etc).
scalability, in general, is a really complex topic, and it just comes down to what kind of resilience you actually need:
1) do you just need users to be auto-logged-in when they come back? just use cookies
2) do you need select state preserved? isolate that and put that much smaller data in the database
3) do you need full session failover between instances? minimize server state -- use as many direct actions as possible, and see #2
4) how large do you ACTUALLY have to scale? be realistic here, and decide whether any of this even matters
in general, the less server state you have, the easier it is to scale. that means the more you rely on stateful component actions, the harder time you'll have. that said, there aren't that many apps where it REALLY matters. I also think a better future direction is probably html5 pushState for bookmarking combined with stateful backends for smoother user experiences. this still means you have to carefully deal with re-entry and authorization.
anyway .... my net advice here is "stop doing that" :)
ms
On Jun 5, 2011, at 11:16 AM, Kevin Hinkson wrote:
> Hi all,
> I'm attempting to implement database session persistence and I am running into some problems.
>
> Questions:
> 1. My Session cannot be serialized. I'm using the old WXCodecUtilities.archivedDataFromObject which seems to work fine. A stack trace shows ERXEC as the culprit? ERXEC is said to implement Serializable and I have no idea what to do next, even to find out which editing context in which class is the culprit.
>
> java.io.NotSerializableException: er.extensions.eof.ERXEC$2
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
> at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
> at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
> at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
> at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
> at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154)
> at java.io.ObjectOutputStream.access$300(ObjectOutputStream.java:143)
> at java.io.ObjectOutputStream$PutFieldImpl.writeFields(ObjectOutputStream.java:1677)
>
>
> My intuition tells me this may have something to do with writing to the database and serializing the session state at the same time. Does anyone have any pointers or should I look for a different approach to handle scaling up app servers and implementing sign in "Remember Me" for long periods of time?
>
> ---
> Kevin Hinkson
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden