You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by kpub <kp...@actcom.net.il> on 2003/09/04 08:37:52 UTC

Visit object concurrent access

Hi,

I'm new to Tapestry/servlet development so forgive me if this is to dumb 
question.

As I understand from the servlet spec the servlet container permit 
concurrent request handling within the
same session context. "Multiple servlets executing request threads may 
have active access to a single session
object at the same time. The Developer has the responsibility to 
synchronize access to resources stored in
the session as appropriate".

My conclusion is that access to the visit object must be synchronized. 
Is it so?


Thanks
Yaniv.


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Visit object concurrent access

Posted by kpub <kp...@actcom.net.il>.
Howard M. Lewis Ship wrote:

>If you have an application that makes heavy use of frames then, yes, you should be concerned about
>multiple threads updating the Visit object simultaneously.  Tapestry itself is threadsafe.
>
>--
>Howard M. Lewis Ship
>Creator, Tapestry: Java Web Components
>http://jakarta.apache.org/tapestry
>http://jakarta.apache.org/commons/sandbox/hivemind/
>http://javatapestry.blogspot.com
>
>  
>
>>-----Original Message-----
>>From: kpub [mailto:kpub@actcom.net.il] 
>>Sent: Thursday, September 04, 2003 2:38 AM
>>To: tapestry-user@jakarta.apache.org
>>Subject: Visit object concurrent access
>>
>>
>>Hi,
>>
>>I'm new to Tapestry/servlet development so forgive me if this 
>>is to dumb 
>>question.
>>
>>As I understand from the servlet spec the servlet container permit 
>>concurrent request handling within the
>>same session context. "Multiple servlets executing request 
>>threads may 
>>have active access to a single session
>>object at the same time. The Developer has the responsibility to 
>>synchronize access to resources stored in
>>the session as appropriate".
>>
>>My conclusion is that access to the visit object must be 
>>synchronized. 
>>Is it so?
>>
>>
>>Thanks
>>Yaniv.
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>  
>
Thanks for the replies

I'm not using frames in my web app but my concern is abut user opening more
than one page containing my app (isn't the effect is like in using 
frames?).
I don't see any reason to allow the user concurrent access to the 
visit/session so I'm
considering overriding the ApplicationServlet::doService() methos with 
one that
synchronize on the session. Is it right thing to do?

What about serializing. Who is responsible of synchronizing and data 
consistency?
Is it guaranteed that there isn't any active session when serializing 
the visit?


Yaniv.


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Visit object concurrent access

Posted by "F. Da Costa Gomez" <dc...@fixed.com>.
Thx for the confirmation

Howard M. Lewis Ship wrote:

>Yes, what I was getting at is that frames can force multithreaded access to shared objects such as
>the Visit.
>
>If your page is a <frameset>, and many of the <frames> are actually additonal Tapestry pages then,
>yes, you can expect to see some multithreaded access to the Visit ... however, multithreaded reads
>are rarely a problem and it is somewhat unlikely that multiple requests that will cause updates will
>occur simultaneously.
>
>--
>Howard M. Lewis Ship
>Creator, Tapestry: Java Web Components
>http://jakarta.apache.org/tapestry
>http://jakarta.apache.org/commons/sandbox/hivemind/
>http://javatapestry.blogspot.com
>
>  
>
>>-----Original Message-----
>>From: F. Da Costa Gomez [mailto:dcg@fixed.com] 
>>Sent: Thursday, September 04, 2003 9:10 AM
>>To: Tapestry users
>>Subject: Re: Visit object concurrent access
>>
>>
>>Howard M. Lewis Ship wrote:
>>
>>    
>>
>>>If you have an application that makes heavy use of frames then, yes, 
>>>you should be concerned about multiple threads updating the Visit 
>>>object simultaneously.  Tapestry itself is threadsafe.
>>>
>>>      
>>>
>>I am assuming you are referring to ... heavy use of frames... 
>>as in the 
>>multiple frames doing *simultaneous* updating.
>>Opposed to just using frames without all of them shooting off 
>>requests 
>>all of the time.
>>
>>Is this a save assumption?
>>
>>TIA,
>>Fermin DCG
>>
>>    
>>
>>>--
>>>Howard M. Lewis Ship
>>>Creator, Tapestry: Java Web Components 
>>>http://jakarta.apache.org/tapestry
>>>http://jakarta.apache.org/commons/sandbox/hivemind/
>>>http://javatapestry.blogspot.com
>>>
>>> 
>>>
>>>      
>>>
>>>>-----Original Message-----
>>>>From: kpub [mailto:kpub@actcom.net.il]
>>>>Sent: Thursday, September 04, 2003 2:38 AM
>>>>To: tapestry-user@jakarta.apache.org
>>>>Subject: Visit object concurrent access
>>>>
>>>>
>>>>Hi,
>>>>
>>>>I'm new to Tapestry/servlet development so forgive me if this
>>>>is to dumb 
>>>>question.
>>>>
>>>>As I understand from the servlet spec the servlet container permit
>>>>concurrent request handling within the
>>>>same session context. "Multiple servlets executing request 
>>>>threads may 
>>>>have active access to a single session
>>>>object at the same time. The Developer has the responsibility to 
>>>>synchronize access to resources stored in
>>>>the session as appropriate".
>>>>
>>>>My conclusion is that access to the visit object must be
>>>>synchronized. 
>>>>Is it so?
>>>>
>>>>
>>>>Thanks
>>>>Yaniv.
>>>>
>>>>
>>>>------------------------------------------------------------
>>>>        
>>>>
>>---------
>>    
>>
>>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>>For additional commands, e-mail: 
>>>>        
>>>>
>>tapestry-user-help@jakarta.apache.org
>>    
>>
>>>>   
>>>>
>>>>        
>>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: 
>>>      
>>>
>>tapestry-user-help@jakarta.apache.org
>>    
>>
>>>
>>>
>>> 
>>>
>>>      
>>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
>
>  
>




---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: Visit object concurrent access

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
Yes, what I was getting at is that frames can force multithreaded access to shared objects such as
the Visit.

If your page is a <frameset>, and many of the <frames> are actually additonal Tapestry pages then,
yes, you can expect to see some multithreaded access to the Visit ... however, multithreaded reads
are rarely a problem and it is somewhat unlikely that multiple requests that will cause updates will
occur simultaneously.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com

> -----Original Message-----
> From: F. Da Costa Gomez [mailto:dcg@fixed.com] 
> Sent: Thursday, September 04, 2003 9:10 AM
> To: Tapestry users
> Subject: Re: Visit object concurrent access
> 
> 
> Howard M. Lewis Ship wrote:
> 
> >If you have an application that makes heavy use of frames then, yes, 
> >you should be concerned about multiple threads updating the Visit 
> >object simultaneously.  Tapestry itself is threadsafe.
> >
> I am assuming you are referring to ... heavy use of frames... 
> as in the 
> multiple frames doing *simultaneous* updating.
> Opposed to just using frames without all of them shooting off 
> requests 
> all of the time.
> 
> Is this a save assumption?
> 
> TIA,
> Fermin DCG
> 
> >
> >--
> >Howard M. Lewis Ship
> >Creator, Tapestry: Java Web Components 
> >http://jakarta.apache.org/tapestry
> >http://jakarta.apache.org/commons/sandbox/hivemind/
> >http://javatapestry.blogspot.com
> >
> >  
> >
> >>-----Original Message-----
> >>From: kpub [mailto:kpub@actcom.net.il]
> >>Sent: Thursday, September 04, 2003 2:38 AM
> >>To: tapestry-user@jakarta.apache.org
> >>Subject: Visit object concurrent access
> >>
> >>
> >>Hi,
> >>
> >>I'm new to Tapestry/servlet development so forgive me if this
> >>is to dumb 
> >>question.
> >>
> >>As I understand from the servlet spec the servlet container permit
> >>concurrent request handling within the
> >>same session context. "Multiple servlets executing request 
> >>threads may 
> >>have active access to a single session
> >>object at the same time. The Developer has the responsibility to 
> >>synchronize access to resources stored in
> >>the session as appropriate".
> >>
> >>My conclusion is that access to the visit object must be
> >>synchronized. 
> >>Is it so?
> >>
> >>
> >>Thanks
> >>Yaniv.
> >>
> >>
> >>------------------------------------------------------------
> ---------
> >>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: 
> tapestry-user-help@jakarta.apache.org
> >>
> >>    
> >>
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: 
> tapestry-user-help@jakarta.apache.org
> >
> >
> >
> >
> >  
> >
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Visit object concurrent access

Posted by "F. Da Costa Gomez" <dc...@fixed.com>.
Howard M. Lewis Ship wrote:

>If you have an application that makes heavy use of frames then, yes, you should be concerned about
>multiple threads updating the Visit object simultaneously.  Tapestry itself is threadsafe.
>
I am assuming you are referring to ... heavy use of frames... as in the 
multiple frames doing *simultaneous* updating.
Opposed to just using frames without all of them shooting off requests 
all of the time.

Is this a save assumption?

TIA,
Fermin DCG

>
>--
>Howard M. Lewis Ship
>Creator, Tapestry: Java Web Components
>http://jakarta.apache.org/tapestry
>http://jakarta.apache.org/commons/sandbox/hivemind/
>http://javatapestry.blogspot.com
>
>  
>
>>-----Original Message-----
>>From: kpub [mailto:kpub@actcom.net.il] 
>>Sent: Thursday, September 04, 2003 2:38 AM
>>To: tapestry-user@jakarta.apache.org
>>Subject: Visit object concurrent access
>>
>>
>>Hi,
>>
>>I'm new to Tapestry/servlet development so forgive me if this 
>>is to dumb 
>>question.
>>
>>As I understand from the servlet spec the servlet container permit 
>>concurrent request handling within the
>>same session context. "Multiple servlets executing request 
>>threads may 
>>have active access to a single session
>>object at the same time. The Developer has the responsibility to 
>>synchronize access to resources stored in
>>the session as appropriate".
>>
>>My conclusion is that access to the visit object must be 
>>synchronized. 
>>Is it so?
>>
>>
>>Thanks
>>Yaniv.
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
>  
>




---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: Visit object concurrent access

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
If you have an application that makes heavy use of frames then, yes, you should be concerned about
multiple threads updating the Visit object simultaneously.  Tapestry itself is threadsafe.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com

> -----Original Message-----
> From: kpub [mailto:kpub@actcom.net.il] 
> Sent: Thursday, September 04, 2003 2:38 AM
> To: tapestry-user@jakarta.apache.org
> Subject: Visit object concurrent access
> 
> 
> Hi,
> 
> I'm new to Tapestry/servlet development so forgive me if this 
> is to dumb 
> question.
> 
> As I understand from the servlet spec the servlet container permit 
> concurrent request handling within the
> same session context. "Multiple servlets executing request 
> threads may 
> have active access to a single session
> object at the same time. The Developer has the responsibility to 
> synchronize access to resources stored in
> the session as appropriate".
> 
> My conclusion is that access to the visit object must be 
> synchronized. 
> Is it so?
> 
> 
> Thanks
> Yaniv.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org