TorqueUser loses persistent object during session replication

View: New views
4 Messages — Rating Filter:   Alert me  

Parent Message unknown TorqueUser loses persistent object during session replication

by Declan Shanaghy-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello list,
I'm having a slight problem with TorqueUser
session replication in my turbine 2.3.1 app.

When the session is replicated the underlying
persistent object in TorqueUser is lost.

The tempStorage, permStorage and lastAccessDate
fields are all valid but the persistent object is
null, upon first access it is initialized to its
default value which is an empty object.

This causes my app to fail because it is being told the user is
logged in when hasLoggedIn() returns true but the returned user object is
empty.

I have been able to workaround by checking for
user.hasLoggedIn() == true && user.getName() == null
and then reload the TorqueUser into the runData object
just as if the user was logging into the app
but I'd prefer to find a real solution than have to work around this.


The Persistent object and all of its fields are not transient so
the data should be replicated just like everything else?

Does anyone have any idea why this is happening?



Cheers,
Declan Shanaghy


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Re: TorqueUser loses persistent object during session replication

by wglass :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Declan,

I think TorqueUser is not serializable.  I corrected this in the svn for the
2.3x branch.  I'm using svn head for that branch, it seems pretty stable.

https://issues.apache.org/jira/browse/TRB-41

WILL

On Dec 3, 2007 1:24 PM, Declan Shanaghy <turbine@...> wrote:

> Hello list,
> I'm having a slight problem with TorqueUser
> session replication in my turbine 2.3.1 app.
>
> When the session is replicated the underlying
> persistent object in TorqueUser is lost.
>
> The tempStorage, permStorage and lastAccessDate
> fields are all valid but the persistent object is
> null, upon first access it is initialized to its
> default value which is an empty object.
>
> This causes my app to fail because it is being told the user is
> logged in when hasLoggedIn() returns true but the returned user object is
> empty.
>
> I have been able to workaround by checking for
> user.hasLoggedIn() == true && user.getName() == null
> and then reload the TorqueUser into the runData object
> just as if the user was logging into the app
> but I'd prefer to find a real solution than have to work around this.
>
>
> The Persistent object and all of its fields are not transient so
> the data should be replicated just like everything else?
>
> Does anyone have any idea why this is happening?
>
>
>
> Cheers,
> Declan Shanaghy
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@...
> For additional commands, e-mail: user-help@...
>
>


--
Forio Business Simulations

Will Glass-Husain
wglass@...
www.forio.com

RE: TorqueUser loses persistent object during session replication

by Declan Shanaghy-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I had a sneaking suspicion that subclassing TorqueUser
and marking it serializable would not work

Do fields of the parent objects in a hierarchy not get serialized
when a subclass is marked serializable?




 

-----Original Message-----
From: Will Glass-Husain [mailto:wglasshusain@...]
Sent: Tuesday, December 04, 2007 8:53 AM
To: Turbine Users List
Subject: Re: TorqueUser loses persistent object during session replication

Hi Declan,

I think TorqueUser is not serializable.  I corrected this in the svn for the
2.3x branch.  I'm using svn head for that branch, it seems pretty stable.

https://issues.apache.org/jira/browse/TRB-41

WILL

On Dec 3, 2007 1:24 PM, Declan Shanaghy <turbine@...> wrote:

> Hello list,
> I'm having a slight problem with TorqueUser
> session replication in my turbine 2.3.1 app.
>
> When the session is replicated the underlying
> persistent object in TorqueUser is lost.
>
> The tempStorage, permStorage and lastAccessDate
> fields are all valid but the persistent object is
> null, upon first access it is initialized to its
> default value which is an empty object.
>
> This causes my app to fail because it is being told the user is
> logged in when hasLoggedIn() returns true but the returned user object is
> empty.
>
> I have been able to workaround by checking for
> user.hasLoggedIn() == true && user.getName() == null
> and then reload the TorqueUser into the runData object
> just as if the user was logging into the app
> but I'd prefer to find a real solution than have to work around this.
>
>
> The Persistent object and all of its fields are not transient so
> the data should be replicated just like everything else?
>
> Does anyone have any idea why this is happening?
>
>
>
> Cheers,
> Declan Shanaghy
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@...
> For additional commands, e-mail: user-help@...
>
>


--
Forio Business Simulations

Will Glass-Husain
wglass@...
www.forio.com


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


RE: TorqueUser loses persistent object during session replication

by Declan Shanaghy-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Wait a second, scratch that.

The tempStorage, permStorage and lastAccessTime
are all being serialized successfully so my workaround
is valid.

It is the TorqueObject.obj (declared as type
org.apache.torque.om.Persistent)
that is not being serialized correctly.
Its real implementation derives from org.apache.torque.om.BaseObject which
is also serializable.

All the classes in my chain are serializable (otherwise i would see
NotSerializableException
(like i posted on the dev list). Its just that data thats being lost.



-----Original Message-----
From: Declan Shanaghy [mailto:turbine@...]
Sent: Tuesday, December 04, 2007 4:41 PM
To: 'Turbine Users List'
Subject: RE: TorqueUser loses persistent object during session replication

I had a sneaking suspicion that subclassing TorqueUser
and marking it serializable would not work

Do fields of the parent objects in a hierarchy not get serialized
when a subclass is marked serializable?




 

-----Original Message-----
From: Will Glass-Husain [mailto:wglasshusain@...]
Sent: Tuesday, December 04, 2007 8:53 AM
To: Turbine Users List
Subject: Re: TorqueUser loses persistent object during session replication

Hi Declan,

I think TorqueUser is not serializable.  I corrected this in the svn for the
2.3x branch.  I'm using svn head for that branch, it seems pretty stable.

https://issues.apache.org/jira/browse/TRB-41

WILL

On Dec 3, 2007 1:24 PM, Declan Shanaghy <turbine@...> wrote:

> Hello list,
> I'm having a slight problem with TorqueUser
> session replication in my turbine 2.3.1 app.
>
> When the session is replicated the underlying
> persistent object in TorqueUser is lost.
>
> The tempStorage, permStorage and lastAccessDate
> fields are all valid but the persistent object is
> null, upon first access it is initialized to its
> default value which is an empty object.
>
> This causes my app to fail because it is being told the user is
> logged in when hasLoggedIn() returns true but the returned user object is
> empty.
>
> I have been able to workaround by checking for
> user.hasLoggedIn() == true && user.getName() == null
> and then reload the TorqueUser into the runData object
> just as if the user was logging into the app
> but I'd prefer to find a real solution than have to work around this.
>
>
> The Persistent object and all of its fields are not transient so
> the data should be replicated just like everything else?
>
> Does anyone have any idea why this is happening?
>
>
>
> Cheers,
> Declan Shanaghy
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@...
> For additional commands, e-mail: user-help@...
>
>


--
Forio Business Simulations

Will Glass-Husain
wglass@...
www.forio.com


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...