Since you say that CASes are never being released, perhaps you need to trace the
code where you think an acquired cas ought to be being released, and see why
that code path doesn't call the releaseJCas(cas) method?
Also, were there any log / error messages generated?
-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
>