Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eeYno-0006rN-LT for pgsql-general@arkaria.postgresql.org; Thu, 25 Jan 2018 04:06:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eeYno-0001ZW-9J for pgsql-general@arkaria.postgresql.org; Thu, 25 Jan 2018 04:06:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eeYnn-0001ZM-Uo for pgsql-general@lists.postgresql.org; Thu, 25 Jan 2018 04:06:16 +0000 Received: from mail-it0-x22d.google.com ([2607:f8b0:4001:c0b::22d]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eeYnl-00026t-4i for pgsql-general@postgresql.org; Thu, 25 Jan 2018 04:06:15 +0000 Received: by mail-it0-x22d.google.com with SMTP id m11so20363006iti.1 for ; Wed, 24 Jan 2018 20:06:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=/vdMGkP+AXNEr9brp44eWuXnD0eODqVgacCU5/V4ZRc=; b=d9FjVdxv1tAPgdsjD89JxHgnxMzGkxX3ZTkyaujrGnjoRFghdJIou9aTsmWOjCLw9w ZlhZpYX/lasMXgAwRjd6aL8e3Vyvqq8cpOJfBrnIDBVcvZolPGzNiGWh4UvYjI1nNaZg Jm/di8ZenvbrOc7yFP69a15moJQYwXhJC8fUdzSvNTpkUZDADs6nC9xBNxlSeNU7NeVL wOOZDQ0P5qr4oVpMZdu7QYbY4eKc7qaAFtLJVq/DxEykVlRNWHwwYsJrWNMVjyKhOG2a Fe+DkwimzODFmF4XZnCaHcja5Sutj3DLiWjk6+s3cwkc5RlzgNo4KF4S5L390kSm/WLv +z0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=/vdMGkP+AXNEr9brp44eWuXnD0eODqVgacCU5/V4ZRc=; b=RhjXPP+pdMxkAic6vhgrdNi1R4HFq4IlcqejPYbKCt6tHHXWVjAgzgfGy84Ej99znL y5Cc614i0jyN0PzsbRpYntq9zh5QYxcGXc9QzwYjm0sso6XHvgINMgDzoPg0Y0fvpUh7 VW5DbEaJg6oi1ilE13syvOL3TYYeAChlMCCr8jFfXPps432O3kfpKwoKyeDpuuSBLifR b9OlkVcCkPwjzNlCM3jYnTIhcL762s3zitnedEoWvt1xYp+UaujvIAljGU+5cckvhKqt v04pACTx5indaVEdlfUkP1yQ0/IMJE0idtDlLusefMXA9ElnuhWIUCCk3Vupno0iFdY4 We3A== X-Gm-Message-State: AKwxytdqIx6wE23SBx+TZtEipSk8BR1HBkYX4Kz8tFVAKznAhtAulAAR sJceBETHBwy4Aqyl+VOXPUI= X-Google-Smtp-Source: AH8x226nIFFTibWUtpmwsMykIoXb1B5HPqfBdo5fWYtDVf7mU0kVN7TFkOAExvoW0s4COsL3DTHzYQ== X-Received: by 10.36.192.10 with SMTP id u10mr11447546itf.73.1516853170403; Wed, 24 Jan 2018 20:06:10 -0800 (PST) Received: from ?IPv6:2601:681:5500:1e3c:64f5:c6fc:8942:baad? ([2601:681:5500:1e3c:64f5:c6fc:8942:baad]) by smtp.gmail.com with ESMTPSA id f7sm1096064iod.60.2018.01.24.20.06.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jan 2018 20:06:10 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: CannotAcquireResourceException in Junit From: Rob Sargent In-Reply-To: Date: Wed, 24 Jan 2018 21:06:10 -0700 Cc: "pgsql-general@postgresql.org" Content-Transfer-Encoding: quoted-printable Message-Id: <75636663-BC9A-4DFD-BA21-3DCF16852A82@gmail.com> References: To: Abhra Kar X-Mailer: Apple Mail (2.3273) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On Jan 24, 2018, at 9:57 AM, Abhra Kar wrote: >=20 > =20 > Hi, > I am getting the following error while running bunch of Junit = test cases through =E2=80=9Cant test=E2=80=9D command---- > Caused by: = com.mchange.v2.resourcepool.CannotAcquireResourceException: A = ResourcePool could not acquire a resource from its primary factory or = source.=20 > PFA full stack trace. > =20 > After execution of 300 test cases I got this error. The setup() method = code snippet is --- >=20 > @Before > public void setUp() throws Exception { =20 > entityManager =3D = entityManagerFactory.createEntityManager();//javax.persistence.EntityManag= er > entityManager.getTransaction().begin(); > } >=20 > this method ran for all 300 test cases but didn=E2=80=99t get error . > =20 > 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. >=20 > Thanks and Regards, > Abhra > Apparently Merlin is busy elsewhere. You need to name the OS, the = postgres version, and the stack you=E2=80=99re using. But my guess is you=E2=80=99re not closing those connections and have = hit a configuration limit for maximum connection.