Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Time of last visit reset on JForum restart (HSQLDB?)

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm not sure if this is HSQLDB specific or not, but that's what I'm running for my database, so I thought I'd mention that first .

Anyways, every time I restart Tomcat the "last visited on" time for the user I'm testing with resets to the time at which I created the user. While everyting is up and running, I can log out and log back in again, and it shows a properly updated "last visited on" time, but as soon as I shut things down and start back up, it reverts.

I'm not 100% sure that this is a bug, because I'm setting the JForum servlet to run on Tomcat startup, so I figured I'd mention it here before reporting it on JIRA. The reason for having it run on startup is that I've created an auto-login JSP page that needs the backend to be started up before it will work properly. I don't see how this could be causing this problem, but you never know :?.

Regards,
Colin
[originally posted on jforum.net by Colin Walsh]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, the problem is with your restarts. For the sake of performance, I don't hit the database all the time to update the user's session data. I only do that when he logs off, or when the user comes back to the site, after leaving it (logging off or not).

So, when you restart the servlet container, you don't give a change to the values be updated.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The thing is, it happens even if I log the user out before I restart the container.

-Colin
[originally posted on jforum.net by Colin Walsh]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm.. if you click in the link "Logout", I write the information to the database. Check the method "lougout()" in UserAction.java:

https://jforum.dev.java.net/source/browse/jforum/src/net/jforum/view/forum/UserAction.java?rev=1.39&view=markup

It's the call to "userSession.storeSessionData()"

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!