Has no one seen this problem, or is it a dumb question? I worked
around it by maintaining login/create/modify time information in a
separate table, and updating myself upon login or logout. But I'm not
thrilled about it.
Incidentally, mySQL has a "feature" that the first TIMESTAMP column in
any record is automagically updated with the current time whenever
that record is modified in any way. Is that consistent with the
intent of the Visitor.MODIFIED column?
-- Travis
Travis Low wrote:
>
> The application I'm developing has a "BrowseUsers" screen on which I
> display the last login date and time. To display this information, I
> retrieve the Visitor.LASTLOGIN for each user. For the turbine user
> (default user), the value in LASTLOGIN is correct. For other users,
> the LASTLOGIN value is correct only for the duration of the session.
> After logging out, the value reverts to 20021130000000 (midnight
> November 30, 2002 for some strange reason).
>
> So I ran some selects from the mysql interpreter. The results:
>
> mysql> select LOGINID,CREATED,MODIFIED,LASTLOGIN FROM Visitor;
> +---------+---------+----------------+----------------+
> | LOGINID | CREATED | MODIFIED | LASTLOGIN |
> +---------+---------+----------------+----------------+
> | turbine | NULL | 20000816162126 | 20000816162126 |
> | kelly | NULL | 20000815171052 | 20021130000000 |
>
> Then I logged in as "kelly" and checked again:
>
> mysql> select LOGINID,CREATED,MODIFIED,LASTLOGIN FROM Visitor;
> +---------+---------+----------------+----------------+
> | LOGINID | CREATED | MODIFIED | LASTLOGIN |
> +---------+---------+----------------+----------------+
> | turbine | NULL | 20000816162126 | 20000816162126 |
> | kelly | NULL | 20000816164941 | 20000816164941 |
>
> And then I logged out:
>
> mysql> select LOGINID,CREATED,MODIFIED,LASTLOGIN FROM Visitor;
> +---------+---------+----------------+----------------+
> | LOGINID | CREATED | MODIFIED | LASTLOGIN |
> +---------+---------+----------------+----------------+
> | turbine | NULL | 20000816162126 | 20000816162126 |
> | kelly | NULL | 20000815171052 | 20021130000000 |
>
> Notice that both the MODIFIED and LASTLOGIN fields are restored to
> their original values.
>
> I am using the org/apache/turbine/modules/actions/LogoutUser.java
> action to do logout. It calls method saveToStorage() in
> org/apache/turbine/om/user/peer/TurbineUserPeer.java. That method
> looks like this:
>
> public void saveToStorage() throws Exception
> {
> // this is where we should save the permStorage hashtable
> // to the database if we can get a connection to the database
> // First any hashtable entries which have a column assigned
> // are placed for storage in their respective column.
> Hashtable permData = (Hashtable) getPermStorage().clone();
> Criteria criteria = new Criteria();
> criteria.add( TurbineUserPeer.VISITOR_ID, getId()
> );
>
> for (int i=1; i<TurbineUserPeer.columnNames.length; i++ )
> {
> if (
> permData.containsKey(TurbineUserPeer.criteriaKeys[i]) )
> {
> criteria.add( TurbineUserPeer.criteriaKeys[i],
>
> permData.remove(TurbineUserPeer.criteriaKeys[i]) );
> }
> }
> criteria.add( TurbineUserPeer.OBJECT_DATA, permData
> );
> TurbineUserPeer.doUpdate(criteria);
> }
>
> I didn't dig any deeper than that, because I don't know much about
> using Criteria yet. Anyone know what's wrong? Is it a bug, or do I
> have a configuration issue?
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]