pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: Abhra Kar <abhra.kar@gmail.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: CannotAcquireResourceException in Junit
Date: Wed, 24 Jan 2018 21:06:10 -0700
Message-ID: <75636663-BC9A-4DFD-BA21-3DCF16852A82@gmail.com> (raw)
In-Reply-To: <CAFNULEfBcXOaWAbxGX2hHKGjM7q55+G7ZJSTVXw9TgJ8bu_S1A@mail.gmail.com>
References: <CAFNULEfBcXOaWAbxGX2hHKGjM7q55+G7ZJSTVXw9TgJ8bu_S1A@mail.gmail.com>


> On Jan 24, 2018, at 9:57 AM, Abhra Kar <abhra.kar@gmail.com> wrote:
> 
>  
> Hi,
>          I am getting the following error while running bunch of Junit test cases through “ant test” command----
>  Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source. 
> PFA full stack trace.
>  
> After execution of 300 test cases I got this error. The setup() method code snippet is ---
> 
> @Before
>     public void setUp() throws Exception {     
>         entityManager = entityManagerFactory.createEntityManager();//javax.persistence.EntityManager
>         entityManager.getTransaction().begin();
> }
> 
> this method ran for all 300 test cases but didn’t get error .
>  
> Another 900 test cases are remaining. I tried running single test cases from those test cases, getting same error for all.
> What is root cause of this error.
> 
> Thanks and Regards,
> Abhra
> <StackTrace.doc>
Apparently Merlin is busy elsewhere.  You need to name the OS, the postgres version, and the stack you’re using.

But my guess is you’re not closing those connections and have hit a configuration limit for maximum connection.






view thread (6+ messages)  latest in thread

Message-ID: <75636663-BC9A-4DFD-BA21-3DCF16852A82@gmail.com>
Permalink:  ../75636663-BC9A-4DFD-BA21-3DCF16852A82@gmail.com/
Also on:    postgresql.org/message-id/75636663-BC9A-4DFD-BA21-3DCF16852A82@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: robjsargent@gmail.com, abhra.kar@gmail.com
  Subject: Re: CannotAcquireResourceException in Junit
  In-Reply-To: <75636663-BC9A-4DFD-BA21-3DCF16852A82@gmail.com>
  References: <CAFNULEfBcXOaWAbxGX2hHKGjM7q55+G7ZJSTVXw9TgJ8bu_S1A@mail.gmail.com> <75636663-BC9A-4DFD-BA21-3DCF16852A82@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox