You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Brett Palmer <br...@gmail.com> on 2010/11/18 10:56:07 UTC

Re: Unable to acquire a new connection from the pool

We are seeing errors about unable to acquire a new connection pool from
MySQL.  The entityengine.xml pool-minsize and pool-maxsize are set
correctly.  We have a pool-maxsize of 250 which we never reacher.

I think the problem may be an idle connection problem where the DB host
system cuts the database connection from the application server because it
is idle.  This thread talks about setting the "idle connect" for MySQL but
doesn't give any specifics.  I don't see any parameter in the JDBC setting
for an idle connection value.  Is this a server configuration.

The following is the stack trace that we are seeing.  We've been running
this server for over a year now and just started getting these error.  Any
suggestions on the topic is appreciated.


Brett

/******************************/

Nov 17 01:13:21 app01 logger: Exception: java.sql.SQLException
Nov 17 01:13:21 app01 logger: Message: Unable to acquire a new connection
from the pool
Nov 17 01:13:21 app01 logger: ---- cause
---------------------------------------------------------------------
Nov 17 01:13:21 app01 logger: Exception:
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException
Nov 17 01:13:21 app01 logger: Message: Could not create connection to
database server. Attempted reconnect 3 times. Giving up.
Nov 17 01:13:21 app01 logger: ---- cause
---------------------------------------------------------------------
Nov 17 01:13:21 app01 logger: Exception: java.net.ConnectException
Nov 17 01:13:21 app01 logger: Message: Connection refused
Nov 17 01:13:21 app01 logger: ---- stack trace
---------------------------------------------------------------
Nov 17 01:13:21 app01 logger: java.net.ConnectException: Connection refused
Nov 17 01:13:21 app01 logger: java.net.PlainSocketImpl.socketConnect(Native
Method)
Nov 17 01:13:21 app01 logger:
java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
Nov 17 01:13:21 app01 logger:
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
Nov 17 01:13:21 app01 logger:
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
Nov 17 01:13:21 app01 logger:
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)


On Wed, Jan 13, 2010 at 9:14 AM, Kumaraswamy nandipati <
kumaraswamy@ecomzera.com> wrote:

> Hi Juan Pablo,
>
> I am having the same problem in my ofbiz instance till earlier of December,
> 2009. In my case I am using MySQL as database. After a long research on the
> database, we identified that *idle connection time outs* are happening with
> MySQL.
>
> If you are using MySQL as database, after changing configuration settings
> for idle connection in mysql, we haven't face this problem from then.
>
>
>
> On Wed, Jan 13, 2010 at 12:35 PM, Jacques Le Roux <
> jacques.le.roux@les7arts.com> wrote:
>
> > From: "rohit" <ro...@yahoo.com>
> >
> >  Hi,
> >>
> >> Please also check the jobsandbox database for any service not properly
> >> terminated, for eg. they are still in the running status.
> >>
> >> i had a lot of problem with us service not ending properly. even with
> the
> >> latest code running i have to manually delete some running process on
> the
> >> database. Each running process seems to block 1 - 2 pool connection and
> >> hence the error. currently for eg. the sendorderconfirmation email gets
> >> stuck as a running process for a long time.
> >>
> >
> > A Jira issue is pending for that
> > https://issues.apache.org/jira/browse/OFBIZ-2974
> >
> > Jacques
> >
> >
> >  Hope it help.
> >>
> >> Rohit
> >>
> >>
> >> Juan Pablo wrote:
> >>
> >>>
> >>> Hi Community.
> >>>
> >>> Today I had a lot of error messages when I execute some operations:
> >>> Update
> >>> Product, Facility Receipt, etc.
> >>>
> >>> This is one of the error messages:
> >>>
> >>> ------
> >>>
> >>> Error en la llamada el evento:
> >>> org.ofbiz.webapp.event.EventHandlerException:
> >>> Service invocation error (Could not commit transaction for service
> >>> [updateProduct] call: Roll back error, could not commit transaction,
> was
> >>> rolled back instead because of: Failure in findByCondition operation
> for
> >>> entity [ProductDimension]: org.ofbiz.entity.GenericDataSourceException:
> >>> Unable to esablish a connection with the database. (Unable to acquire a
> >>> new
> >>> connection from the pool). Rolling back
> >>> transaction.org.ofbiz.entity.GenericDataSourceException: Unable to
> >>> esablish
> >>> a connection with the database. (Unable to acquire a new connection
> from
> >>> the
> >>> pool) (Unable to esablish a connection with the database. (Unable to
> >>> acquire
> >>> a new connection from the pool)))
> >>>
> >>> ------
> >>> I understand that the main erro is "Unable to acquire a new connection
> >>> from
> >>> the pool" but I donĀ“t understand how I can resolve.
> >>>
> >>> I use a local installation with a unique user!
> >>>
> >>> Thaks.
> >>>
> >>> --
> >>> Juan Pablo
> >>>
> >>>
> >>>
> >> --
> >> View this message in context:
> >>
> http://n4.nabble.com/Unable-to-acquire-a-new-connection-from-the-pool-tp1012609p1012691.html
> >> Sent from the OFBiz - User mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
>
> --
> Thanks,
> Kumaraswamy.N
> 91-9866805250.
>

Re: Unable to acquire a new connection from the pool

Posted by rohit <ro...@yahoo.com>.
hi,

i generally saw such error caused due to some services not terminating
properly. For eg. in such cases i would shut down ofbiz and check the
'JobSandbox' table to see if any process is still in the running state. If
yes, i assume it means that the job did not terminate and is causing the
problem. i will try to delete that records and then re-start ofbiz. if may
not be the right way, but it worked for us.

thanks

Rohit
http://www.saanjhi.com www.saanjhi.com 


-- 
View this message in context: http://ofbiz.135035.n4.nabble.com/Unable-to-acquire-a-new-connection-from-the-pool-tp1012609p3051282.html
Sent from the OFBiz - User mailing list archive at Nabble.com.