RE: PATCH : jmsServerSessionPool
"Tim Anderson" <tima-k+1zm/[email protected]>
| Newsgroups | gmane.comp.java.openjms.devel |
|---|---|
| Message-ID | <[email protected]> |
Patch applied.
Thanks,
Tim
> -----Original Message-----
> From: openjms-developer-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> [mailto:openjms-developer-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org]On Behalf Of Day,
> Jem BGI WAC
> Sent: Friday, January 31, 2003 8:33 AM
> To: 'openjms-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org'
> Subject: [openjms-developer] PATCH : jmsServerSessionPool
>
>
>
> Hi,
>
> There seemed to be a potential synchronization problem when
> an attempt was made to obtain a session from the Pool.
>
> I changed getServerSession() to :
>
>
> Attached is a diff file.
>
> public ServerSession getServerSession()
> throws JMSException
> {
> ServerSession result = null;
>
> try
> {
> synchronized(sessionPool_)
> {
>
> while (sessionPool_.size() == 0)
> {
> try {
> // Wait for a Session to be returned.
> sessionPool_.wait();
> }
> catch (InterruptedException ie)
> {
> // Swallow this
> }
> }
>
> // Grab a Session.
> result = (ServerSession)sessionPool_.remove(0);
> }
>
> }
> catch (Exception exception)
> {
> throw new JMSException("Error in getServerSession " +
> exception);
> }
>
> return result;
> }
>
> Jem..
>
>
>
>
> <<diff.txt>>
>