You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Shane Beasley <sb...@acm.org> on 2006/07/20 04:56:52 UTC

TorqueUser serializes, but underlying TurbineUser does not?

I'm using the Torque security service with Turbine-2.3.2 under Tomcat 
5.0. I've tried using Torque 3.1.1 and 3.2 but have the same problem 
with both:

If I restart (or reload) Tomcat while I'm logged into my Turbine web 
application, I find that Turbine still thinks that I'm logged in, but 
doesn't remember anything about the TurbineUser associated with my session.

Further investigation indicates that the TorqueUser associated with my 
login session is serialized while Tomcat goes down, but when it comes 
back up, the TurbineUser associated with that TorqueUser is empty.

To test, I wrote the following utility method:

    public static <E> E serialize(E object) throws Exception {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        new ObjectOutputStream(baos).writeObject(object);
        return (E)new ObjectInputStream(new 
ByteArrayInputStream(baos.toByteArray())).readObject();
    }

Results are as thus:

1. turbine_user.getUserName() is equal to 
serialize(turbine_user).getUserName()
2. torque_user.hasLoggedIn() is equal to 
serialize(torque_user).hasLoggedIn()
3. torque_user.getName() is NOT equal to serialize(torque_user).getName()

(1) and (2) suggest that TurbineUser and TorqueUser are both 
"self-serializable", but (3) suggests that TorqueUser doesn't serialize 
(or unserialize?) its underlying TurbineUser.

Ideally, I'd like to have TorqueUser properly serialize and/or 
unserialize its TurbineUser. Any suggestions?

Thanks!

Shane

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org