Return-Path: Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: (qmail 52859 invoked from network); 20 Aug 2009 09:03:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 20 Aug 2009 09:03:19 -0000 Received: (qmail 3898 invoked by uid 500); 20 Aug 2009 09:03:37 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 3821 invoked by uid 500); 20 Aug 2009 09:03:37 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Delivered-To: moderator for users@myfaces.apache.org Received: (qmail 86981 invoked by uid 99); 20 Aug 2009 08:51:46 -0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of vojtech.zavrel@gmail.com designates 209.85.220.224 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=JNFxHFEUbp0+g/RppBVVbtYd3Gv88QyCzVVl8waIUVo=; b=Ez9+MhBkQBsB09pkeMs+7c22tSww2w4hi67oPw8qpxMrEPO6+ir4isvY27szGqF96/ goE30vooCum2M6D+do/AexnKRo+8Pjzlu/NxMsKkwfZxyQIttQirZF2ltUea5rhyxfKR 9eF3mk1J5ui6uJX5Rp0MOTz3/ijIe1XuSZJ74= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=pQg6W5jXNDmVmLJvYKbwwMVkmrosQ0gMHi1RfNwIAtkQrm5NxUMpn1gyEwm8Z6dcN1 K2VOG0DfSQXEPv27coqpy3O86fUrI1JSNMJ94wTkP2vpsVULsd1eN9EcH8UGeV7MUHHY z3LRtuVK1FrHsBtA9WOjBibc9lu3FTVhDBCc8= MIME-Version: 1.0 Sender: vojtech.zavrel@gmail.com Date: Thu, 20 Aug 2009 10:51:15 +0200 X-Google-Sender-Auth: 3a9fa7c329f31e68 Message-ID: <73721da20908200151g2ed4aec7t175e23b4dcbded1d@mail.gmail.com> Subject: Concurrent requests and Orchestra From: Vojtech Zavrel To: users@myfaces.apache.org Content-Type: multipart/alternative; boundary=0015175cadb0b9db2404718eda4f X-Virus-Checked: Checked by ClamAV on apache.org --0015175cadb0b9db2404718eda4f Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi, we have a problem with concurrent request using combination Orchestra + Spring + Trinidad. The application uses more than one window per session, so we have migrated all our beans to orchestra's conversation scope using conversation.manual. We have a progress bar which is poling AJAX request during the main request is being done. Once user is waiting to the main request, there are partial requests each five seconds using Trinidad Javascript API. To be able handle more requests the partial request goes in another frame with same conversationContext. Both partial and full request are accessing to the same bean. And this is the problem because there is there is ReentrantLock used not to be able to access to FacesContex from different thread. So that means, that we are not able to access to the progressbar model and the partial request is locked till the full request is finished. But I haven't understood why there is this concurrent limitatins because they aren't in other scopes. This is the comment from the source code: // Fetch a context for this request if one already exists, and lock it 72 // so that concurrent requests that affect this context block until 73 // this request is complete. Not doing so can cause races for resources 74 // within the current context, such as beans or PersistenceContexts. But what kind of races and why there are not same problems using other scopes. Can anybody explain me the reasons please? Is there any possibility how to make a workaround? Thanks Daemon Thread [http-8080-1] (Suspended) Object.wait(long) line: not available [native method] [local variables unavailable] _ReentrantLock.lockInterruptibly() line: 80 ConversationContext.lockInterruptablyForCurrentThread() line: 475 ContextLockRequestHandler.init(FacesContext) line: 96 OrchestraFacesContextFactory$1.(OrchestraFacesContextFactory, FacesContext, boolean, LinkedList, FacesContext) line: 119 OrchestraFacesContextFactory.getFacesContext(Object, Object, Object, Lifecycle) line: 100 RequestParameterFacesContextFactory.getFacesContext(Object, Object, Object, Lifecycle) line: 92 FacesContextFactoryImpl.getFacesContext(Object, Object, Object, Lifecycle) line: 64 FacesServlet.service(ServletRequest, ServletResponse) line: 260 ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 290 ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206 TrinidadFilterImpl._invokeDoFilter(ServletRequest, ServletResponse, FilterChain) line: 238 TrinidadFilterImpl._doFilterImpl(ServletRequest, ServletResponse, FilterChain) line: 195 TrinidadFilterImpl.doFilter(ServletRequest, ServletResponse, FilterChain) line: 138 TrinidadFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 92 ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235 ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206 LicenseFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 123 ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235 ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206 ResponseHeaderFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 54 ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235 ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206 SessionTimeoutFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 116 ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235 ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206 StandardWrapperValve.invoke(Request, Response) line: 233 StandardContextValve.invoke(Request, Response) line: 175 StandardHostValve.invoke(Request, Response) line: 128 ErrorReportValve.invoke(Request, Response) line: 102 StandardEngineValve.invoke(Request, Response) line: 109 CoyoteAdapter.service(Request, Response) line: 263 Http11Processor.process(Socket) line: 844 Http11Protocol$Http11ConnectionHandler.process(Socket) line: 584 JIoEndpoint$Worker.run() line: 447 Thread.run() line: 619 --0015175cadb0b9db2404718eda4f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,
=C2=A0we have a problem with concurrent request using combination Orchestra + Spring + Trinidad. The application uses more than one window per session, so we have migrated all our beans to orchestra's conversation scope using conversation.manual.
We have a progress bar which is poling AJAX request during the main request is being done. Once user is waiting to the main request, there are partial requests each five seconds using Trinidad Javascript API. To be able handle more requests the partial request goes in another frame with same conversationContext.
Both partial and full request are accessing to the same bean. And this is the problem because there is there is ReentrantLock used not to be able to access to FacesContex from different thread.
So that means, that we are not able to access to the progressbar model and the partial request is locked till the full request is finished.<= font size=3D"-1"> But I haven&#= 39;t understood why there is this concurrent limitatins because they aren't in other scopes.

This is the comment from the source code:
=C2=A0
// Fetch a context for this request if one already exists, and lock it
72 // so that concurrent requests that affect this context block until
73 // this request is complete. Not doing so can cause races for resources
74 // within the current context, such as beans or PersistenceContexts.

But what kind of races and why there are not same problems using other scopes.
Can anybody explain me the reasons please? Is there any possibility how to make a workaround?

Thanks


Daemon Thread [http-8080-1] (Suspended)
Object.wait(long) line: not available [native method] [local variables unavailable]
_ReentrantLock.lockInterruptibly() line: 80
ConversationContext.lockInterruptablyForCurrentThread() line: 475
ContextLockRequestHandler.init(FacesContext) line: 96
OrchestraFacesContextFactory$1.<init>(OrchestraFacesContextFactory, FacesContext, boolean, LinkedList, FacesContext) line: 119
OrchestraFacesContextFactory.getFacesContext(Object, Object, Object, Lifecycle) line: 100
RequestParameterFacesContextFactory.getFacesContext(Object, Object, Object, Lifecycle) line: 92
FacesContextFactoryImpl.getFacesContext(Object, Object, Object, Lifecycle) line: 64
FacesServlet.service(ServletRequest, ServletResponse) line: 260
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 290
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206
TrinidadFilterImpl._invokeDoFilter(ServletRequest, ServletResponse, FilterChain) line: 238
TrinidadFilterImpl._doFilterImpl(ServletRequest, ServletResponse, FilterChain) line: 195
TrinidadFilterImpl.doFilter(ServletRequest, ServletResponse, FilterChain) line: 138
TrinidadFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 92
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206
LicenseFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 123
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206
ResponseHeaderFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 54
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206
SessionTimeoutFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 116
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206
StandardWrapperValve.invoke(Request, Response) line: 233
StandardContextValve.invoke(Request, Response) line: 175
StandardHostValve.invoke(Request, Response) line: 128
ErrorReportValve.invoke(Request, Response) line: 102
StandardEngineValve.invoke(Request, Response) line: 109
CoyoteAdapter.service(Request, Response) line: 263
Http11Processor.process(Socket) line: 844
Http11Protocol$Http11ConnectionHandler.process(Socket) line: 584
JIoEndpoint$Worker.run() line: 447
Thread.run() line: 619
--0015175cadb0b9db2404718eda4f--