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 How use JCasPool when is exhausted
Date Fri, 09 Jun 2017 10:09:00 GMT
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

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