uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josep María Formentí Serra <jmforme...@aia.es>
Subject Re: How use JCasPool when is exhausted
Date Mon, 12 Jun 2017 10:02:21 GMT
Oooops, you're right this was the problem, the "do" is missing

Thanks a lot!

2017-06-09 17:17 GMT+02:00 Marshall Schor <msa@schor.com>:

> Hi,
>
> I'm having some trouble understanding your code snippet.
>
> Perhaps you intended to have a "do { .... } while (cas == null), but it
> appears
> the "do" is missing?
>
> -Marshall
>
>
> On 6/9/2017 6:09 AM, Josep María Formentí Serra wrote:
> > Hi all,
> >
> >   I have doubts how to control when the pool, JCasPool, is exhausted.
> >
> >   I'm trying something like this:
> >
> >             JCasPool casPool = new JCasPool(100,
> > segmenter.getAnalysisEngineMetaData());
> >
> >             ....
> >
> >             if (cas == null) {
> >                 synchronized (casPool) {
> >                     {
> >                         casPool.wait();
> >                         cas = casPool.getJCas();
> >                     }
> >                     while (cas == null);
> >                 }
> >             }
> >
> >  For release just: casPool.releaseJCas(cas);
> >
> >  This is not working for me, because when there are a lot of requests the
> > application finally is blocked: the pool is full and never is released a
> > CAS.
> >
> > Thanks,
> >   JM
> >
>
>


-- 
------------------------------------------------------------------- --- --
- - -
*Grupo AIA* - *www.aia.es <http://www.aia.es> *
Josep Mª Formentí Serra       <jmformenti@aia.ptv.es>
*jmformenti@aia.es <jmformenti@aia.ptv.es>*Dpto. Servicios Financieros y
Seguros
ESADECREAPOLIS, Sant Cugat, Barcelona
Telf.: +34 93 504 49 00 Fax.: +34 93 580 21 88
------------------------------------------------------------------- --- --
- - -
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from any
computer.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message