Add new attachment

Only authorized users are allowed to upload new attachments.

List of attachments

Kind Attachment Name Size Version Date Modified Author Change note
patch
SessionMonitor.patch 8.6 kB 1 01-Nov-2006 07:55 206.152.117.245
patch
WikiSession.patch 0.4 kB 1 01-Nov-2006 07:54 206.152.117.245

This page (revision-11) was last changed on 13-Nov-2006 23:29 by JanneJalkanen  

This page was created on 30-Oct-2006 13:44 by JanneJalkanen

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Difference between version and

At line 3 changed 2 lines
|Version|2.4.x
|Submitter|JanneJalkanen
|Version|2.4.21
|Submitter|TimBass
At line 7 changed one line
|[Bug status]|NewBug
|[Bug status]|ClosedBug
At line 39 added 60 lines
----
I uploaded two patch files which fix this bug.
SessionMonitor.java was modified to use the container for storing
WikiSession's. With this change it no longer needs to run as a
background thread. This simplifies the management of WikiSession's
and allows it to work no matter how a container might manage HttpSession's
internally. This also will allow WikiSessions to survive container or web application restarts. WikiSession was modified to remove the code to start
the SessionMonitor background thread.
You need to add the following to the web.xml after the filter-mappings.
{{{
<!--
HttpSessionListener used for managing WikiSession's.
-->
<listener>
<listener-class>com.ecyrd.jspwiki.auth.SessionMonitor</listener-class>
</listener>
}}}
One additional change is needed. WikiSession should implement java.io.Serializable so that it can be marshalled out with the HttpSession by the container to persistent storage during a container or web application restart or if HttpSession's are clustered between multiple application servers or stored in a database.
--Glenn Nielsen, 01-Nov-2006
----
One final note. I subscribed using mailman to both the JSPWiki dev and user lists. I never received an subscription e-mails. It sure would be easier to discuss these types of bugs and patches on a mailing list.
--Glenn Nielsen, 01-Nov-2006
Yes, they would be. I'm a bit worried that you didn't receive the subscription emails. Can you try again? If it still does not work, send me private email.
Andrew, do you have a comment on these?
(From my side I don't think WikiSession can be marshalled because it includes a reference to a WikiEngine, and that most certainly is not serializable.)
-- JanneJalkanen, 01-Nov-2006
----
This seems like a pretty good set of revisions. Certainly, it's a good idea to use existing J2EE methods rather than cook up our own scheme. (Although, if we wanted to use less radical surgery we could simply use the session ID as a key rather than the HttpSession.) We would need to make sure that it works as advertised on the most popular web app servers, although I can't see why it wouldn't.
As for the reason why WikiSession isn't stored in the HTTP session - it's because there are a LOT of strong references that we'd bring in to the HTTP session if we did that. It would cause a memory leak. In fact, in previous versions it WAS in the HttpSession -- after a bunch of memory profiling I figured it would be better to remove it.
Tim and Glenn -- thanks for your work on this.
--Andrew Jaquith, 01-Nov-2006
Looks solid enough; I'll incorporate this into the stable branch soonish.
-- JanneJalkanen, 10-Nov-2006
----
Incorporated into 2.4.80. Thanks heaps guys!
Version Date Modified Size Author Changes ... Change note
11 13-Nov-2006 23:29 5.998 kB JanneJalkanen to previous
10 11-Nov-2006 00:32 5.939 kB 82.181.5.170 to previous | to last
9 01-Nov-2006 16:54 5.828 kB Andrew Jaquith to previous | to last
8 01-Nov-2006 16:54 5.778 kB Andrew Jaquith to previous | to last Comment by Andrew Jaquith
7 01-Nov-2006 10:29 4.992 kB JanneJalkanen to previous | to last
6 01-Nov-2006 10:27 4.836 kB JanneJalkanen to previous | to last
5 01-Nov-2006 10:25 4.83 kB JanneJalkanen to previous | to last
4 01-Nov-2006 08:09 4.592 kB Glenn Nielsen to previous | to last Comment by Glenn Nielsen
3 01-Nov-2006 08:07 4.336 kB Glenn Nielsen to previous | to last Comment by Glenn Nielsen
2 30-Oct-2006 13:45 3.189 kB JanneJalkanen to previous | to last
1 30-Oct-2006 13:44 3.194 kB JanneJalkanen to last
« This page (revision-11) was last changed on 13-Nov-2006 23:29 by JanneJalkanen