Database error - Connection timed out

776 views
Skip to first unread message

Thiru

unread,
Sep 14, 2011, 12:44:32 PM9/14/11
to play-framework
I posted the same question in stackoverflow.

http://stackoverflow.com/questions/7226775/database-error-connection-timed-out

Database error - Connection timed out

I'm using Play framework and phpmyadmin. When I run my application it
crashes with this error:

Database error

A database error occured : Cannot connect to the database, An attempt
by a client to checkout a Connection has timed out.

I cleared my browser Session and run the Play application again but it
shows the same message.

What's the source of the error?

The Error message is

09:45:40,832 INFO ~ Listening for HTTP on port 9000 (Waiting a first
request to start) ...
09:46:11,634 ERROR ~ Cannot connected to the database : An attempt by
a client to checkout a Connection has timed out.
java.sql.SQLException: An attempt by a client to checkout a Connection
has timed out.
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:
106)
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:
65)
at play.db.DBPlugin.onApplicationStart(DBPlugin.java:114)
at
play.plugins.PluginCollection.onApplicationStart(PluginCollection.java:
425)
at play.Play.start(Play.java:492)
at play.Play.detectChanges(Play.java:596)
at play.Invoker$Invocation.init(Invoker.java:186)
at Invocation.HTTP Request(Play!)
Caused by: com.mchange.v2.resourcepool.TimeoutException: A client
timed out while waiting to acquire a resource from
com.mchange.v2.resourcepool.BasicResourcePool@13c952f -- timeout at
awaitAvailable()
at
com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:
1317)
at
com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:
557)
at
com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:
477)
... 6 more
09:46:13,569 ERROR ~

@67k0c6c5i
Internal Server Error (500) for request GET /

Database error
A database error occured : Cannot connected to the database, An
attempt by a client to checkout a Connection has timed out.

play.exceptions.DatabaseException: Cannot connected to the database,
An attempt by a client to checkout a Connection has timed out.
at play.db.DBPlugin.onApplicationStart(DBPlugin.java:132)
at
play.plugins.PluginCollection.onApplicationStart(PluginCollection.java:
425)
at play.Play.start(Play.java:492)
at play.Play.detectChanges(Play.java:596)
at play.Invoker$Invocation.init(Invoker.java:186)
at Invocation.HTTP Request(Play!)
Caused by: java.sql.SQLException: An attempt by a client to checkout a
Connection has timed out.
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:
106)
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:
65)
at play.db.DBPlugin.onApplicationStart(DBPlugin.java:114)
... 5 more
Caused by: com.mchange.v2.resourcepool.TimeoutException: A client
timed out while waiting to acquire a resource from
com.mchange.v2.resourcepool.BasicResourcePool@13c952f -- timeout at
awaitAvailable()
at
com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:
1317)
at
com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:
557)
at
com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:
477)
... 6 more

I found when my internet connection is down then play ends with
connection timed out error.

What could be the source of the error.

Morten Kjetland

unread,
Sep 15, 2011, 1:43:02 AM9/15/11
to play-fr...@googlegroups.com
Are you connecting to a database on the internet? If so, then the play server can not connect to it if your internet connection is down.

Maybe your database server is not running or not listening on the port you are connecting to.

-Morten


--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.


Tomas

unread,
Sep 15, 2011, 2:27:16 AM9/15/11
to play-framework
Try increasing the timeout in application.conf:
db.pool.timeout=5000

Tomas

On Sep 14, 6:44 pm, Thiru <aras...@gmail.com> wrote:
> I posted the same question in stackoverflow.
>
> http://stackoverflow.com/questions/7226775/database-error-connection-...
Reply all
Reply to author
Forward
0 new messages