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-08       - By Kalra, Ashwani

 Back
Reply:     1     2     3     4     5     6     7     8  

That is not the scenario. here two actions are calling the same stateful
session bean's method. when user quickly invokes some other action, while
previous one is still executing. Both action classes/instances are different


Thanks & Regds
Ashwani

Ext: 1860







> -- --Original Message-- --
> From: An interest list for Sun Java Center J2EE Pattern Catalog
> [mailto:J2EEPATTERNS-INTEREST@(protected)]On Behalf Of Vijay K Dasari
> Sent: Friday, April 08, 2005 7:02 PM
> To: J2EEPATTERNS-INTEREST@(protected)
> Subject: Re: concurrency problem
>

>

> Hi,
>

> If you are using STRUTS and you want to prevent the user from

> submitting the
> same page twice(by immediate clicks) we can use Tokens from

> STRUTS, so that
> we make only first click valid.
>

> Action class has - saveToken() and isTokenValid() methods.
>

>

> Vijay.
>

> > -- --Original Message-- --
> > From: An interest list for Sun Java Center J2EE Pattern Catalog
> > [mailto:J2EEPATTERNS-INTEREST@(protected)]On Behalf Of

> Deepak Nagaraj
> > Sent: Friday, April 08, 2005 8:19 AM
> > To: J2EEPATTERNS-INTEREST@(protected)
> > Subject: Re: concurrency problem
> >
> >
> > Hi Ashwani,
> >
> >  I totally agree with what abhijit has mentioned. Application server
> > serializes the calls to the Session beans.
> >
> > It would be ideal case to handle the multiple clicks or simultaneous
> > clicks in the Action classes. If you are using struts framework, a
> > feature is already provided to handle it.
> >
> > With Regards,
> > Deepak Nagaraj
> >
> >
> > -- --Original Message-- --
> > From: An interest list for Sun Java Center J2EE Pattern Catalog
> > [mailto:J2EEPATTERNS-INTEREST@(protected)] On Behalf Of

> abhijeet rai
> > Sent: Friday, April 08, 2005 5:34 PM
> > To: J2EEPATTERNS-INTEREST@(protected)
> > Subject: Re: concurrency problem
> >
> > Hi Ashwani,
> >
> > please read below from the EJB spec 2.0 which is old
> > spec version --
> >
> > ===========> > EJB 2.0 spec
> > ===========> > "[6.5.6] Serializing session bean methods
> > A container serializes calls to each session bean
> > instance.Most containers will support many instances
> > of a session bean executing concurrently; however,
> > each instance sees only a serialized sequence of
> > method calls. Therefore a session bean does not have
> > to be coded as reentrant.
> >
> > The container must serialize all the container-invoked
> > callbacks (ejbPassivate, beforeCompletion, ...)
> >
> > Clients are not allowed to make concurrent calls to a
> > SFSB(Stateful Session Bean).The container must throw a
> > java.rmi.Exception to the second client.This
> > restriction does not apply to SLSB(Stateless Session
> > Bean)."
> >
> > Please check EJB spec 2.1 if you are using it and
> > confirm whether this is still valid.
> >
> > Hope this helps.
> >
> > Cheers
> > Abhijeet
> > BEA Support Engineer
> >
> > --- "Kalra, Ashwani" <ashwani.kalra@(protected)>
> > wrote:
> > >
> > > I am facing concurrency problem in following
> > > scenario.
> > >
> > >
> > >
> > > 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.
> > >
> > > 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
> > >
> > >
> > >
> > > execute(...) //execute methods of Action class
> > >
> > > {
> > >
> > > .....
> > >
> > > .....
> > >
> > > //Obtain the session from Request.User will always
> > > be in session here
> > >
> > > session=request.getSession()
> > >
> > > Synchronised(session)
> > >
> > > {
> > >
> > > //call ejb's business method.
> > >
> > > }
> > >
> > >
> > >
> > > }
> > >
> > > 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.
> > >
> > > Can there be problem in above code. Is it ok to
> > > synchronise on session object.
> > >
> > > Thanks & Regds
> > >  Ashwani
> > >
> > > Ext: 1860
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > 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)
> > >
> >
> >
> >
> > __ ____ ____ ____ ____ ____ ______
> > Do you Yahoo!?
> > Yahoo! Mail - 250MB free storage. Do more. Manage less.
> > http://info.mail.yahoo.com/mail_250
> >
> > ===================================================================> >
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)
> > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> >
> > Information transmitted by this EMAIL is proprietary to iGATE
> > Group of Companies and is intended for use only by the individual
> > or entity to whom it is addressed and may contain information
> > that is privileged, confidential, or exempt from disclosure under
> > applicable law. If you are not the intended recipient of this
> > EMAIL immediately notify the sender at iGATE or mailadmin@(protected)
> > and delete this EMAIL including any attachments
> > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> >
> > ===================================================================> >
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 email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> __ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ __
>

> ===================================================================>
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.