Gary,

I'm not sure how much time was spent discussing alternatives as apposed
to the question of if getting access to all sessions would work. 

You originally talked about tracking for concurrent license checking...

We currently do this type of thing - and more, like abstracting the
session from the http session so the http session can time out and
return resources without actually losing the user session, concurrent
connections versus concurrent users, etc. Furthermore we have multiple
servers running the same app so that simply holding the information
locally in the VM is not sufficient. 

We handle tracking all of this stuff via the database. Thus the
distributed nature of our app and the precise lifecycle of the
HttpSession are not so important.

The downside to all this is that you have to be careful how you track
activity via the db. How/when do you log activity? How do you write your
connection-checking queries so you don't have performance issues?
How/when do you cache stuff locally to help improve performance? How do
you efficiently write logs for usage tracking? Using the DB works but it
does take some tuning (as we found out ;-).

Brian



-->-----Original Message-----
-->From: [EMAIL PROTECTED] 
-->[mailto:[EMAIL PROTECTED] 
-->Sent: Wednesday, September 19, 2007 5:05 AM
-->To: Tomcat Users List
-->Subject: Re: How do you access all sessions from a servlet 
-->in tomcat 6.0?
-->
-->
-->Thanks for all the feedback on this.
-->
-->___________________________
-->
-->Gary Johnstone
-->Engineering IT
-->Cummins Turbo Technologies Ltd
-->+44 1484 440532
-->
-->
-->
-->
-->
-->
-->                                                             
-->              
-->             Lyallex                                         
-->              
-->             <[EMAIL PROTECTED]                               
-->              
-->             m>                                              
-->           To 
-->                                       "Tomcat Users List"   
-->              
-->             19/09/2007 10:38          
--><users@tomcat.apache.org>           
-->                                                             
-->           cc 
-->                                                             
-->              
-->             Please respond to                               
-->      Subject 
-->               "Tomcat Users           Re: How do you access 
-->all sessions  
-->                   List"               from a servlet in 
-->tomcat 6.0?       
-->             <[EMAIL PROTECTED]                               
-->              
-->                 che.org>                                    
-->              
-->                                                             
-->              
-->                                                             
-->              
-->                                                             
-->              
-->                                                             
-->              
-->
-->
-->
-->
-->OK, for some reason I've been obsessing about this for a 
-->whole day now.
-->
-->If you hold an external reference to a Session then 
-->according to my tests the session will still time out as 
-->expected but the external reference will be non null. At the 
-->very least this means that you may end up with a large 
-->number of useless references taking up space in memory. Of 
-->course you can always remove an invalid or timed out 
-->reference in the sessionDestroyed method of your listener.
-->
-->There are a whole bunch of other issues surrounding this but 
-->I'm sure you've sussed them out for yourself already.
-->
-->Anyway, I'll shut up now.
-->
-->Rgds
-->Duncan
-->
-->
-->On 9/19/07, Lyallex <[EMAIL PROTECTED]> wrote:
-->> On 9/18/07, Lyallex <[EMAIL PROTECTED]> wrote:
-->> > How about creating a SessionListener
-->> >
-->> > class SomeSessionListener implements HttpSessionListener ...
-->> >
-->> > Register it in web.xml
-->> >
-->> > in the sessionCreated method of your listener get a 
-->reference to the 
-->> > new session from the HttpSessionEvent you can now access the 
-->> > getLastAccessedTime(), maybe store the refs in some singleton ...
-->>
-->> ...er, actually I think this could be a REALLY STUPID idea 
-->as I hadn't 
-->> thought about what happens if you maintain an external 
-->reference to a 
-->> session and the session expires...
-->>
-->> Investigating now
-->>
-->> Duncan
-->>
-->
-->---------------------------------------------------------------------
-->To start a new topic, e-mail: users@tomcat.apache.org To 
-->unsubscribe, e-mail: [EMAIL PROTECTED]
-->For additional commands, e-mail: [EMAIL PROTECTED]
-->
-->
-->
-->_____________
-->This e-mail transmission and any attachments to it are 
-->intended solely for the use of the individual or entity to 
-->whom it is addressed and may contain confidential and 
-->privileged information.  If you are not the intended 
-->recipient, your use, forwarding, printing, storing, 
-->disseminating, distribution, or copying of this 
-->communication is prohibited.  If you received this 
-->communication in error, please notify the sender immediately 
-->by replying to this message and delete it from your computer.
-->
-->
-->---------------------------------------------------------------------
-->To start a new topic, e-mail: users@tomcat.apache.org To 
-->unsubscribe, e-mail: [EMAIL PROTECTED]
-->For additional commands, e-mail: [EMAIL PROTECTED]
-->
-->

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to