Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
JSP - A mailing list about Java Server Pages specification and reference
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Subject: Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Subject: Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
concurrency problem

concurrency problem

2005-04-11       - By Kalra, Ashwani

 Back
Reply:     1     2     3     4     5     6     7     8  

hi,
Thanks for this info. I have also found the problem. There was another call
going for different method at the same time which  was not synchronised.

Regds
Ashwani




> -- --Original Message-- --
> From: An interest list for Sun Java Center J2EE Pattern Catalog
> [mailto:J2EEPATTERNS-INTEREST@(protected)]On Behalf Of Glenn Phillips
> Sent: Saturday, April 09, 2005 12:14 AM
> To: J2EEPATTERNS-INTEREST@(protected)
> Subject: Re: concurrency problem
>

>

> For what it is worth, try using request.getSession(false)

> instead. You may
> have been running into a situation where you were not

> synchronizing on a
> unique object. I'm not sure which server you are using, but it may be
> returning a new session object instance (not logical

> instance) when there is
> an exclusive hold on the prior session instance.
>

> My two cents,
>

> Glenn
>

> &gt;From: &quot;Kalra, Ashwani&quot;

> &lt;ashwani.kalra@(protected)&gt;
> &gt;Reply-To: An interest list for Sun Java Center J2EE

> Pattern Catalog
> &lt;J2EEPATTERNS-INTEREST@(protected)&gt;
> &gt;To: J2EEPATTERNS-INTEREST@(protected)
> &gt;Subject: concurrency problem
> &gt;Date: Fri, 8 Apr 2005 16:53:22 +0530
> &gt;MIME-Version: 1.0
> &gt;Received: from swjscmail2.java.sun.com ([192.18.99.108]) by
> mc1-f4.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Fri,

> 8 Apr 2005
> 04:33:53 -0700
> &gt;Received: from swjscmail1 (swjscmail1.Sun.COM [192.18.99.107])by
> swjscmail2.java.sun.com (Postfix) with ESMTPid 93C7D21548;

> Fri,  8 Apr 2005
> 05:25:51 -0600 (MDT)
> &gt;Received: from JAVA.SUN.COM by JAVA.SUN.COM

> (LISTSERV-TCP/IP release
> 1.8e) with          spool id 60503412 for
> J2EEPATTERNS-INTEREST@(protected); Fri, 8 Apr          2005

> 05:20:06 -0600
> &gt;Received: from mxeorb01.capgemini.com (mxeorb01.capgemini.com
> [198.184.232.82])          by swjscmail1.java.sun.com

> (Postfix) with ESMTP
> id EB5F848EC for

> &lt;J2EEPATTERNS-INTEREST@(protected)&gt;; Fri,
> 8 Apr 2005 05:10:04 -0600          (MDT)
> &gt;Received: from mxiorb01.capgemini.com (crayfish

> [205.223.236.82]) by
>       mxeorb01.capgemini.com (8.13.3/8.12.11) with ESMTP id

> j38BNYrK000092
>         for &lt;J2EEPATTERNS-INTEREST@(protected)&gt;; Fri,

> 8 Apr 2005
> 13:23:34          +0200 (MEST)
> &gt;Received: from mxiorb01.capgemini.com (localhost [127.0.0.1]) by
>   mxiorb01.capgemini.com (8.13.3/8.12.11) with ESMTP id j38BNYYH012071
>     for &lt;J2EEPATTERNS-INTEREST@(protected)&gt;; Fri, 8

> Apr 2005 13:23:34
>           +0200 (MEST)
> &gt;Received: from ntbomexmta.corp.capgemini.com (ntbomexmta

> [10.48.144.55])
> by          mxiorb01.capgemini.com (8.13.3/8.13.3) with ESMTP id
> j38BNIvu011860          for

> &lt;J2EEPATTERNS-INTEREST@(protected)&gt;; Fri,
> 8 Apr 2005 13:23:33          +0200 (MEST)
> &gt;Received: from BOMEX001.corp.capgemini.com ([10.48.144.53]) by
> ntbomexmta.corp.capgemini.com with Microsoft SMTPSVC(6.0.3790.211);
> Fri, 8 Apr 2005 16:53:25 +0530
> &gt;X-Message-Info: nNbrIwMvXSSAJPzo4M4qM2xyKJV3NDtps+cNnG9EuGE> &gt;X
-Original-To: J2EEPATTERNS-INTEREST@(protected)
> &gt;Delivered-To: J2EEPATTERNS-INTEREST@(protected)
> &gt;X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0
> &gt;Content-class: urn:content-classes:message
> &gt;X-MS-Has-Attach:
> &gt;X-MS-TNEF-Correlator:
> &gt;Thread-Topic: concurrency problem
> &gt;Thread-Index: AcU8LV+wY1ytqkN/SOyzTMyr9o8W7w=> &gt;X-OriginalArrivalTime:
08 Apr 2005 11:23:25.0588 (UTC)
>      FILETIME=[61706D40:01C53C2D]
> &gt;Precedence: list
> &gt;Return-Path: owner-j2eepatterns-interest@(protected)
> &gt;
> &gt;
> &gt;I am facing concurrency problem in following scenario.
> &gt;
> &gt;
> &gt;
> &gt;All our action classes call same stateful session bean .

> Each action
> class obtains the reference from HTTPSession object and calls

> one and only
> one business method.
> &gt;
> &gt;To prevent the concurrent access to this instance which

> occurs when user
> immediately presses two links quickly in succession I am

> using the following
> code block
> &gt;
> &gt;
> &gt;
> &gt;execute(...) //execute methods of Action class
> &gt;
> &gt;{
> &gt;
> &gt;.....
> &gt;
> &gt;.....
> &gt;
> &gt;//Obtain the session from Request.User will always be in

> session here
> &gt;
> &gt;session=request.getSession()
> &gt;
> &gt;Synchronised(session)
> &gt;
> &gt;{
> &gt;
> &gt;//call ejb's business method.
> &gt;
> &gt;}
> &gt;
> &gt;
> &gt;
> &gt;}
> &gt;
> &gt;However sometimes more than one thread is able to pass

> through, And I
> get exception from Appserver. As 2 threads are not allowed

> for statefull
> Session bean.
> &gt;
> &gt;Can there be problem in above code. Is it ok to

> synchronise on session
> object.
> &gt;
> &gt;Thanks &amp; Regds
> &gt;  Ashwani
> &gt;
> &gt;Ext: 1860
> &gt;
> &gt;
> &gt;
> &gt;
> &gt;
> &gt;
> &gt;
> &gt;This message contains information that may be privileged

> or confidential
> and is the property of the Capgemini Group. It is intended

> only for the
> person to whom it is addressed. If you are not the intended

> recipient,  you
> are not authorized to read, print, retain, copy, disseminate,

>  distribute,
> or use this message or any part thereof. If you receive this

> message in
> error, please notify the sender immediately and delete all

> copies of this
> message.
> &gt;
> &gt;=========================================================> =========> &gt
;Companion Site: http://www.corej2eepatterns.com
> &gt;J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns
> &gt;List Archive:
> http://archives.java.sun.com/archives/j2eepatterns-interest.html
> &gt;Unsubscribing: email &quot;signoff J2EEPATTERNS-INTEREST&quot; to
> listserv@(protected)
>

> ===================================================================>
Companion Site: http://www.corej2eepatterns.com
> J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns
> List Archive:

> http://archives.java.sun.com/archives/j2eepatterns-interest.html
> Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to

> listserv@(protected)
>


This message contains information that may be privileged or confidential and is
the property of the Capgemini Group. It is intended only for the person to whom
it is addressed. If you are not the intended recipient,  you are not authorized
to read, print, retain, copy, disseminate,  distribute, or use this message or
any part thereof. If you receive this  message in error, please notify the
sender immediately and delete all  copies of this message.

===================================================================Companion
Site: http://www.corej2eepatterns.com
J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns
List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html
Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.