Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1egUTQ-0006vp-LH for pgsql-general@arkaria.postgresql.org; Tue, 30 Jan 2018 11:53:12 +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 1egUTN-0005SR-Sc for pgsql-general@arkaria.postgresql.org; Tue, 30 Jan 2018 11:53:09 +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 1egUTN-0005SH-J6 for pgsql-general@lists.postgresql.org; Tue, 30 Jan 2018 11:53:09 +0000 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1egUTK-0007bX-DH for pgsql-general@postgresql.org; Tue, 30 Jan 2018 11:53:08 +0000 Received: by mail-pg0-x242.google.com with SMTP id z17so7046279pgc.4 for ; Tue, 30 Jan 2018 03:53:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=7G8yeStjVtFHeMAY217HS6GQLuEuXUNsqtl4wysM4r0=; b=kDlCRz2Hb9j/GcU7IUOB0ZDSSVY7zDOkN31pl4RDo0YySCsmTMMCII6Iz4njg1qUe1 3ykWhNpCupZvgjXugpH1+/6qF33CfHAMqBxQyAk/8mhWjQb2jyrzVnNgZyk5Cf7id8QO /ptD9kPi4BQrNJ+mxyo5HBxUyjHHrLr+2Xt5c9wJW6nSKRCeb3JLz/mIUXfPxIlop5SB fjsncrrZrFeUqRIRoOXFODuBI4PXzYL4jKOXaq65Qgwa28iDL1BgQsGw2B78rFyIqAXS EmbnbPChsQdj6g6r58OzVC8wHpoeqfYfoiirgL2EvFh6G5CNSw1w1Ay7aZuofO0dB2/f Q4VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=7G8yeStjVtFHeMAY217HS6GQLuEuXUNsqtl4wysM4r0=; b=fKmUqTa/hTqzMXiiBARsqhKYXkYXdlknTv92a6vrZYz4CvZOZd8dzm4RTtoH3GAfRJ eV9SBqEFiHiCNHHJm5M2INt5NL5p3HiBILU9f+cGWY3FjopAXU+ilc4Apqp/fk+K2MOx E52sMfDbS82Of0bNthQUe/doPE3XQxKolD6amQ1wK3+FPe89/Rn+4A9dLQEwP5uxA/3q uIwyGxXu5VLRuiX6EKosPSA4U/eTEGen/ME30484Q+w3wGXBfwN6+SbElqYv6AJA+mLW Lj4jgt7Z/F81L5MHX5C356MzwPsS3UI09qJiKp7eSKmyUTQoRYhkdMR+iyl6Q+gAdlOx wQtw== X-Gm-Message-State: AKwxytdacLzH3G799Sv1+5kwuj1dS2EzD+U03VTr6X8FSU99whTM0WPD 6MIvkHQUZFDRqSug1RwXb/I= X-Google-Smtp-Source: AH8x227musS8OvPDU+zxJL8/Q2GoAlCsnLBdW6qL4fiSGX7Ey96pyycLevo2uKKsWijO/asoNHpTdg== X-Received: by 2002:a17:902:9044:: with SMTP id w4-v6mr25213190plz.354.1517313183285; Tue, 30 Jan 2018 03:53:03 -0800 (PST) Received: from roblaptop (d49-188-24-178.sun1.vic.optusnet.com.au. [49.188.24.178]) by smtp.gmail.com with ESMTPSA id i9sm45876916pfi.154.2018.01.30.03.53.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Jan 2018 03:53:02 -0800 (PST) Message-ID: <1517313177.3061.7.camel@gmail.com> Subject: Re: CannotAcquireResourceException in Junit From: rob stone To: Abhra Kar , Rob Sargent Cc: "pgsql-general@postgresql.org" Date: Tue, 30 Jan 2018 22:52:57 +1100 In-Reply-To: References: <75636663-BC9A-4DFD-BA21-3DCF16852A82@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.2-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, 2018-01-30 at 15:41 +0530, Abhra Kar wrote: > Hi, > Sorry for late reply. Below options I tried --- > 1>pg_terminate_backend --> Successful execution. > 2> Increase max_connection to 900 in > /var/lib/pgsql/9.5/data/postgresql.conf .After modify restart psql > service--- > service postgresql-9.5 start > service postgresql-9.5 stop > > Then execute select * from pg_stat_activity it shows 2 connections. > > > 3>set cp3p0 options ---- > com.mchange.v2.c3p0.ComboPooledDataSource cpds = new > ComboPooledDataSource(); > cpds.setMaxPoolSize(1000); > cpds.setMaxStatements(0); > cpds.setInitialPoolSize(50); > cpds.setAcquireIncrement(5); > cpds.setAcquireRetryAttempts(5); > > > But the problem still persist.Please provide suggestion. > > Regards, > Abhra > The stack trace you sent with your original post shows hibernate crashing as it has no connection string. You are using hibernate as the go between the RDBMS and your app. The problem is more than likely in your c3p0 package. I haven't a clue what it is supposed to do, but my guess is that the faulty code is there, not with your configuration parameters. My 0.02 worth. HTH, Rob