You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@mohawksoft.com on 2007/03/30 21:53:30 UTC

HttpSession, external storage, session transactions

I'm kind of looking for a couple pointers on a session management issue.

I have a web cluster solution, originally designed for PHP, and am
planning to use it in Java and Tomcat. It provides session locking for
frames and concurrency and manages small to medium sized web clusters. It
assume no session persistence at the web server level or session
stickiness at the load balancer.

The HttpSession system seems to assume that a session object lasts until
it is no longer used, and then gets removed by the garbage collector, and
that sessions are sticky to a particular machine. (Unless the cluster
class is used and all sessions are replicated to all servers.)

In essence, what I need is this simple sort of interaction:

(1) Start session, get data
(2) Web app processes data
(3) End session, save data.


It looks like to do this I would have to create a Manager class, a storage
class and a session class. If there is an easier way, and, of course, one
which is minimally invasive to the tomcat structure, I'd ove to hear it.

I can optimize the code a bit on my end to incorporate a sequence number
or something so that if a session is reopened by a process that has the
most recent version, we can just use what's cached, otherwise we'd
recreate the session object from the new data.

Any ideas?

Thanks in advance,

Mark L. Woodward

P.S.
Of course, everything I do at this level will be available to the Apache
org if it wants it.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: HttpSession, external storage, session transactions

Posted by ma...@mohawksoft.com.
> markw@mohawksoft.com wrote:
>>> markw@mohawksoft.com wrote:
>>>
>>>>> this would be a question for the user list,
>>>>> take a look at the persistence manager
>>>>> http://tomcat.apache.org/tomcat-5.5-doc/config/manager.html
>>>>>
>>>>>
>>>> I kind of split on where to ask this, but it has actually very little
>>>> to
>>>> do with web content sort of things. It has to do with the basic
>>>> underlying
>>>> design of the HttpSession. Manager, and Store classes.
>>>>
>>>> What I'm asking is seemingly not easily done and I'm looking for some
>>>> pointers on how one would go about doing it.
>>>>
>>>> The page you pointed me to is useful for instruction on how to use the
>>>> Manager, but I am looking for information for the best way to augment
>>>> the
>>>> Manager's behavior.
>>>>
>>>>
>>> for that, you will have to look into the source code and figure out for
>>> yourself :)
>>>
>>
>> Well, I sort of hoped people more familiar with the source than myself
>> could give me a couple pointers on how best to approach the project. I
>> have, in fact, looked at the code, but it will take me some time come up
>> to speed on the source.
>>
> well, there are two things in life that everyone learns the hard way,
> nothing is easy, and nothing comes to for free, and in America we also
> learn-if you can't afford, you can always finance it :)
>

Well, using open source one would expect that that there must be someone
willing to help!!!

I'm willing to contribute what ever I write back to the apache/tomcat
project.

>
>>>>> markw@mohawksoft.com wrote:
>>>>>
>>>>>
>>>>>> I'm kind of looking for a couple pointers on a session management
>>>>>> issue.
>>>>>>
>>>>>> I have a web cluster solution, originally designed for PHP, and am
>>>>>> planning to use it in Java and Tomcat. It provides session locking
>>>>>> for
>>>>>> frames and concurrency and manages small to medium sized web
>>>>>> clusters.
>>>>>> It
>>>>>> assume no session persistence at the web server level or session
>>>>>> stickiness at the load balancer.
>>>>>>
>>>>>> The HttpSession system seems to assume that a session object lasts
>>>>>> until
>>>>>> it is no longer used, and then gets removed by the garbage
>>>>>> collector,
>>>>>> and
>>>>>> that sessions are sticky to a particular machine. (Unless the
>>>>>> cluster
>>>>>> class is used and all sessions are replicated to all servers.)
>>>>>>
>>>>>> In essence, what I need is this simple sort of interaction:
>>>>>>
>>>>>> (1) Start session, get data
>>>>>> (2) Web app processes data
>>>>>> (3) End session, save data.
>>>>>>
>>>>>>
>>>>>> It looks like to do this I would have to create a Manager class, a
>>>>>> storage
>>>>>> class and a session class. If there is an easier way, and, of
>>>>>> course,
>>>>>> one
>>>>>> which is minimally invasive to the tomcat structure, I'd ove to hear
>>>>>> it.
>>>>>>
>>>>>> I can optimize the code a bit on my end to incorporate a sequence
>>>>>> number
>>>>>> or something so that if a session is reopened by a process that has
>>>>>> the
>>>>>> most recent version, we can just use what's cached, otherwise we'd
>>>>>> recreate the session object from the new data.
>>>>>>
>>>>>> Any ideas?
>>>>>>
>>>>>> Thanks in advance,
>>>>>>
>>>>>> Mark L. Woodward
>>>>>>
>>>>>> P.S.
>>>>>> Of course, everything I do at this level will be available to the
>>>>>> Apache
>>>>>> org if it wants it.
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>>>>>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>>>>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>>>>
>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>>>
>>>>
>>>>
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: HttpSession, external storage, session transactions

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
markw@mohawksoft.com wrote:
>> markw@mohawksoft.com wrote:
>>     
>>>> this would be a question for the user list,
>>>> take a look at the persistence manager
>>>> http://tomcat.apache.org/tomcat-5.5-doc/config/manager.html
>>>>
>>>>         
>>> I kind of split on where to ask this, but it has actually very little to
>>> do with web content sort of things. It has to do with the basic
>>> underlying
>>> design of the HttpSession. Manager, and Store classes.
>>>
>>> What I'm asking is seemingly not easily done and I'm looking for some
>>> pointers on how one would go about doing it.
>>>
>>> The page you pointed me to is useful for instruction on how to use the
>>> Manager, but I am looking for information for the best way to augment
>>> the
>>> Manager's behavior.
>>>
>>>       
>> for that, you will have to look into the source code and figure out for
>> yourself :)
>>     
>
> Well, I sort of hoped people more familiar with the source than myself
> could give me a couple pointers on how best to approach the project. I
> have, in fact, looked at the code, but it will take me some time come up
> to speed on the source.
>   
well, there are two things in life that everyone learns the hard way, 
nothing is easy, and nothing comes to for free, and in America we also 
learn-if you can't afford, you can always finance it :)

Filip

>>>> markw@mohawksoft.com wrote:
>>>>
>>>>         
>>>>> I'm kind of looking for a couple pointers on a session management
>>>>> issue.
>>>>>
>>>>> I have a web cluster solution, originally designed for PHP, and am
>>>>> planning to use it in Java and Tomcat. It provides session locking for
>>>>> frames and concurrency and manages small to medium sized web clusters.
>>>>> It
>>>>> assume no session persistence at the web server level or session
>>>>> stickiness at the load balancer.
>>>>>
>>>>> The HttpSession system seems to assume that a session object lasts
>>>>> until
>>>>> it is no longer used, and then gets removed by the garbage collector,
>>>>> and
>>>>> that sessions are sticky to a particular machine. (Unless the cluster
>>>>> class is used and all sessions are replicated to all servers.)
>>>>>
>>>>> In essence, what I need is this simple sort of interaction:
>>>>>
>>>>> (1) Start session, get data
>>>>> (2) Web app processes data
>>>>> (3) End session, save data.
>>>>>
>>>>>
>>>>> It looks like to do this I would have to create a Manager class, a
>>>>> storage
>>>>> class and a session class. If there is an easier way, and, of course,
>>>>> one
>>>>> which is minimally invasive to the tomcat structure, I'd ove to hear
>>>>> it.
>>>>>
>>>>> I can optimize the code a bit on my end to incorporate a sequence
>>>>> number
>>>>> or something so that if a session is reopened by a process that has
>>>>> the
>>>>> most recent version, we can just use what's cached, otherwise we'd
>>>>> recreate the session object from the new data.
>>>>>
>>>>> Any ideas?
>>>>>
>>>>> Thanks in advance,
>>>>>
>>>>> Mark L. Woodward
>>>>>
>>>>> P.S.
>>>>> Of course, everything I do at this level will be available to the
>>>>> Apache
>>>>> org if it wants it.
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>>>>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>           
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>>>
>>>>
>>>>         
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>>
>>>
>>>
>>>
>>>       
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>
>>     
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: HttpSession, external storage, session transactions

Posted by ma...@mohawksoft.com.
> markw@mohawksoft.com wrote:
>>> this would be a question for the user list,
>>> take a look at the persistence manager
>>> http://tomcat.apache.org/tomcat-5.5-doc/config/manager.html
>>>
>>
>> I kind of split on where to ask this, but it has actually very little to
>> do with web content sort of things. It has to do with the basic
>> underlying
>> design of the HttpSession. Manager, and Store classes.
>>
>> What I'm asking is seemingly not easily done and I'm looking for some
>> pointers on how one would go about doing it.
>>
>> The page you pointed me to is useful for instruction on how to use the
>> Manager, but I am looking for information for the best way to augment
>> the
>> Manager's behavior.
>>
> for that, you will have to look into the source code and figure out for
> yourself :)

Well, I sort of hoped people more familiar with the source than myself
could give me a couple pointers on how best to approach the project. I
have, in fact, looked at the code, but it will take me some time come up
to speed on the source.
>
>>
>>> markw@mohawksoft.com wrote:
>>>
>>>> I'm kind of looking for a couple pointers on a session management
>>>> issue.
>>>>
>>>> I have a web cluster solution, originally designed for PHP, and am
>>>> planning to use it in Java and Tomcat. It provides session locking for
>>>> frames and concurrency and manages small to medium sized web clusters.
>>>> It
>>>> assume no session persistence at the web server level or session
>>>> stickiness at the load balancer.
>>>>
>>>> The HttpSession system seems to assume that a session object lasts
>>>> until
>>>> it is no longer used, and then gets removed by the garbage collector,
>>>> and
>>>> that sessions are sticky to a particular machine. (Unless the cluster
>>>> class is used and all sessions are replicated to all servers.)
>>>>
>>>> In essence, what I need is this simple sort of interaction:
>>>>
>>>> (1) Start session, get data
>>>> (2) Web app processes data
>>>> (3) End session, save data.
>>>>
>>>>
>>>> It looks like to do this I would have to create a Manager class, a
>>>> storage
>>>> class and a session class. If there is an easier way, and, of course,
>>>> one
>>>> which is minimally invasive to the tomcat structure, I'd ove to hear
>>>> it.
>>>>
>>>> I can optimize the code a bit on my end to incorporate a sequence
>>>> number
>>>> or something so that if a session is reopened by a process that has
>>>> the
>>>> most recent version, we can just use what's cached, otherwise we'd
>>>> recreate the session object from the new data.
>>>>
>>>> Any ideas?
>>>>
>>>> Thanks in advance,
>>>>
>>>> Mark L. Woodward
>>>>
>>>> P.S.
>>>> Of course, everything I do at this level will be available to the
>>>> Apache
>>>> org if it wants it.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>>>
>>>>
>>>>
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: HttpSession, external storage, session transactions

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
markw@mohawksoft.com wrote:
>> this would be a question for the user list,
>> take a look at the persistence manager
>> http://tomcat.apache.org/tomcat-5.5-doc/config/manager.html
>>     
>
> I kind of split on where to ask this, but it has actually very little to
> do with web content sort of things. It has to do with the basic underlying
> design of the HttpSession. Manager, and Store classes.
>
> What I'm asking is seemingly not easily done and I'm looking for some
> pointers on how one would go about doing it.
>
> The page you pointed me to is useful for instruction on how to use the
> Manager, but I am looking for information for the best way to augment the
> Manager's behavior.
>   
for that, you will have to look into the source code and figure out for 
yourself :)
Filip

>   
>> markw@mohawksoft.com wrote:
>>     
>>> I'm kind of looking for a couple pointers on a session management issue.
>>>
>>> I have a web cluster solution, originally designed for PHP, and am
>>> planning to use it in Java and Tomcat. It provides session locking for
>>> frames and concurrency and manages small to medium sized web clusters.
>>> It
>>> assume no session persistence at the web server level or session
>>> stickiness at the load balancer.
>>>
>>> The HttpSession system seems to assume that a session object lasts until
>>> it is no longer used, and then gets removed by the garbage collector,
>>> and
>>> that sessions are sticky to a particular machine. (Unless the cluster
>>> class is used and all sessions are replicated to all servers.)
>>>
>>> In essence, what I need is this simple sort of interaction:
>>>
>>> (1) Start session, get data
>>> (2) Web app processes data
>>> (3) End session, save data.
>>>
>>>
>>> It looks like to do this I would have to create a Manager class, a
>>> storage
>>> class and a session class. If there is an easier way, and, of course,
>>> one
>>> which is minimally invasive to the tomcat structure, I'd ove to hear it.
>>>
>>> I can optimize the code a bit on my end to incorporate a sequence number
>>> or something so that if a session is reopened by a process that has the
>>> most recent version, we can just use what's cached, otherwise we'd
>>> recreate the session object from the new data.
>>>
>>> Any ideas?
>>>
>>> Thanks in advance,
>>>
>>> Mark L. Woodward
>>>
>>> P.S.
>>> Of course, everything I do at this level will be available to the Apache
>>> org if it wants it.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>>
>>>
>>>
>>>
>>>       
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>
>>     
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: HttpSession, external storage, session transactions

Posted by ma...@mohawksoft.com.
> markw@mohawksoft.com wrote:
>> This isn't a question about "how to use" the system in my servlet, it is
>> a
>> question about the best approach to implement different functionality in
>> the server.
>
> Ok, I understand. I suggest forgetting about these design ideas, this is
> bad design IMO.

I would *REALLY* like to understand why you say it is a bad design. It is
my humble opinion that HttpSession is broken. So, I think we have to very
different perspectives, and I'd like to understand yours.

>From my point of view, I think relying on the load balancer to keep
session sticky, or forcing the entire web cluster to replicate is crazy.

I have a system, it is not a database, but sort of acts like one. It is
designed as a shared object cache system. I would like to use it to manage
HttpSessions.

It uses a lock/retrieve and unlock/update interface. When the session
starts, it is locked. When the session is done, it is unlocked and
updated. It should incur no more network bandwidth than the cluster
implementation, but does not force all machines to have all sessions
either.

I can use a serial number system to keep from invalidating the existing
HttpSession object if it is already up to date. This will reduce network
traffic if valid sessions exist on the target machines.

> If you stil want to do it, maybe you can try doing your
> stuff directly in your DB using the session id that Tomcat gives you,
> and otherwise not using the session object.

I already have that, but to be more widely useful, obviously, one would
like to be able to have it work "auto-magically" for Java applets that use
HttpSessions.




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: HttpSession, external storage, session transactions

Posted by Remy Maucherat <re...@apache.org>.
markw@mohawksoft.com wrote:
> This isn't a question about "how to use" the system in my servlet, it is a
> question about the best approach to implement different functionality in
> the server.

Ok, I understand. I suggest forgetting about these design ideas, this is 
bad design IMO. If you still want to do it, maybe you can try doing your 
stuff directly in your DB using the session id that Tomcat gives you, 
and otherwise not using the session object.

-> user list if you want to discuss this more

Rémy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: HttpSession, external storage, session transactions

Posted by ma...@mohawksoft.com.
>>
> I promise you, this is the last time I will respond to you,
> the original link I sent you
> http://tomcat.apache.org/tomcat-6.0-doc/config/manager.html
> *
> now scroll down until you see
> org.apache.catalina.session.PersistentManager
>
> did you even get that far down the document, cause you don't sound like
> you did

Regardless of whether or not you respond, I still have a question for
development. I'll take full blame as it may not be clear what I want to
do. What I want to do seems is not easily done with the current
Manager/Store source.

First, all the storage classes, from what I can see, leave the session
object alive and local on the server. There is a strong assumption the the
session will be local to one box.

If you look at code it seems that the sessions are only written when they
are "pasivated" or expire. There does not seem to be direct way for the
storage system to be notified when the current servlet is done with its
session, only when it expires. It seems a java session must expire before
it is written to the storage system. This doesn't work in a cluster
without the load balancer ensuring that session are sticky to a particular
machine, UNLESS you use the clustering system which replicates the session
to all machines.

This isn't a question about "how to use" the system in my servlet, it is a
question about the best approach to implement different functionality in
the server.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: HttpSession, external storage, session transactions

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
markw@mohawksoft.com wrote:
>> markw@mohawksoft.com wrote:
>>     
>>>> this would be a question for the user list,
>>>> take a look at the persistence manager
>>>> http://tomcat.apache.org/tomcat-5.5-doc/config/manager.html
>>>>         
>>> I kind of split on where to ask this, but it has actually very little to
>>> do with web content sort of things. It has to do with the basic
>>> underlying
>>> design of the HttpSession. Manager, and Store classes.
>>>
>>> What I'm asking is seemingly not easily done and I'm looking for some
>>> pointers on how one would go about doing it.
>>>
>>> The page you pointed me to is useful for instruction on how to use the
>>> Manager, but I am looking for information for the best way to augment
>>> the
>>> Manager's behavior.
>>>       
>> The problem is there's nothing to discuss here. All applications pretty
>> much do what you described:
>> (1) Start session, get data
>> (2) Web app processes data
>> (3) End session, save data.
>>     
>
> Yes I know the applications do it, but I am taking about the session
> management.
>
> I don't want to store the sessions on the local server. I want to store
> them in a centralized repository and use a load balancer without sticky
> sessions. The system works perfectly with PHP, and I am hoping to use it
> in Tomcat.
>   
I promise you, this is the last time I will respond to you,
the original link I sent you
http://tomcat.apache.org/tomcat-6.0-doc/config/manager.html
*
now scroll down until you see
org.apache.catalina.session.PersistentManager

did you even get that far down the document, cause you don't sound like 
you did

Filip
*
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: HttpSession, external storage, session transactions

Posted by ma...@mohawksoft.com.
> markw@mohawksoft.com wrote:
>>> this would be a question for the user list,
>>> take a look at the persistence manager
>>> http://tomcat.apache.org/tomcat-5.5-doc/config/manager.html
>>
>> I kind of split on where to ask this, but it has actually very little to
>> do with web content sort of things. It has to do with the basic
>> underlying
>> design of the HttpSession. Manager, and Store classes.
>>
>> What I'm asking is seemingly not easily done and I'm looking for some
>> pointers on how one would go about doing it.
>>
>> The page you pointed me to is useful for instruction on how to use the
>> Manager, but I am looking for information for the best way to augment
>> the
>> Manager's behavior.
>
> The problem is there's nothing to discuss here. All applications pretty
> much do what you described:
> (1) Start session, get data
> (2) Web app processes data
> (3) End session, save data.

Yes I know the applications do it, but I am taking about the session
management.

I don't want to store the sessions on the local server. I want to store
them in a centralized repository and use a load balancer without sticky
sessions. The system works perfectly with PHP, and I am hoping to use it
in Tomcat.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: HttpSession, external storage, session transactions

Posted by Remy Maucherat <re...@apache.org>.
markw@mohawksoft.com wrote:
>> this would be a question for the user list,
>> take a look at the persistence manager
>> http://tomcat.apache.org/tomcat-5.5-doc/config/manager.html
> 
> I kind of split on where to ask this, but it has actually very little to
> do with web content sort of things. It has to do with the basic underlying
> design of the HttpSession. Manager, and Store classes.
> 
> What I'm asking is seemingly not easily done and I'm looking for some
> pointers on how one would go about doing it.
> 
> The page you pointed me to is useful for instruction on how to use the
> Manager, but I am looking for information for the best way to augment the
> Manager's behavior.

The problem is there's nothing to discuss here. All applications pretty 
much do what you described:
(1) Start session, get data
(2) Web app processes data
(3) End session, save data.

Rémy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: HttpSession, external storage, session transactions

Posted by ma...@mohawksoft.com.
> this would be a question for the user list,
> take a look at the persistence manager
> http://tomcat.apache.org/tomcat-5.5-doc/config/manager.html

I kind of split on where to ask this, but it has actually very little to
do with web content sort of things. It has to do with the basic underlying
design of the HttpSession. Manager, and Store classes.

What I'm asking is seemingly not easily done and I'm looking for some
pointers on how one would go about doing it.

The page you pointed me to is useful for instruction on how to use the
Manager, but I am looking for information for the best way to augment the
Manager's behavior.

>
> markw@mohawksoft.com wrote:
>> I'm kind of looking for a couple pointers on a session management issue.
>>
>> I have a web cluster solution, originally designed for PHP, and am
>> planning to use it in Java and Tomcat. It provides session locking for
>> frames and concurrency and manages small to medium sized web clusters.
>> It
>> assume no session persistence at the web server level or session
>> stickiness at the load balancer.
>>
>> The HttpSession system seems to assume that a session object lasts until
>> it is no longer used, and then gets removed by the garbage collector,
>> and
>> that sessions are sticky to a particular machine. (Unless the cluster
>> class is used and all sessions are replicated to all servers.)
>>
>> In essence, what I need is this simple sort of interaction:
>>
>> (1) Start session, get data
>> (2) Web app processes data
>> (3) End session, save data.
>>
>>
>> It looks like to do this I would have to create a Manager class, a
>> storage
>> class and a session class. If there is an easier way, and, of course,
>> one
>> which is minimally invasive to the tomcat structure, I'd ove to hear it.
>>
>> I can optimize the code a bit on my end to incorporate a sequence number
>> or something so that if a session is reopened by a process that has the
>> most recent version, we can just use what's cached, otherwise we'd
>> recreate the session object from the new data.
>>
>> Any ideas?
>>
>> Thanks in advance,
>>
>> Mark L. Woodward
>>
>> P.S.
>> Of course, everything I do at this level will be available to the Apache
>> org if it wants it.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: HttpSession, external storage, session transactions

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
this would be a question for the user list,
take a look at the persistence manager
http://tomcat.apache.org/tomcat-5.5-doc/config/manager.html

Filip

markw@mohawksoft.com wrote:
> I'm kind of looking for a couple pointers on a session management issue.
>
> I have a web cluster solution, originally designed for PHP, and am
> planning to use it in Java and Tomcat. It provides session locking for
> frames and concurrency and manages small to medium sized web clusters. It
> assume no session persistence at the web server level or session
> stickiness at the load balancer.
>
> The HttpSession system seems to assume that a session object lasts until
> it is no longer used, and then gets removed by the garbage collector, and
> that sessions are sticky to a particular machine. (Unless the cluster
> class is used and all sessions are replicated to all servers.)
>
> In essence, what I need is this simple sort of interaction:
>
> (1) Start session, get data
> (2) Web app processes data
> (3) End session, save data.
>
>
> It looks like to do this I would have to create a Manager class, a storage
> class and a session class. If there is an easier way, and, of course, one
> which is minimally invasive to the tomcat structure, I'd ove to hear it.
>
> I can optimize the code a bit on my end to incorporate a sequence number
> or something so that if a session is reopened by a process that has the
> most recent version, we can just use what's cached, otherwise we'd
> recreate the session object from the new data.
>
> Any ideas?
>
> Thanks in advance,
>
> Mark L. Woodward
>
> P.S.
> Of course, everything I do at this level will be available to the Apache
> org if it wants it.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org