When firing a lot of queries through my play 2.5 app, I get errors like these:
error] c.g.m.a.d.p.PostgreSQLConnection - Error with message -> ErrorMessage(fields=Map(Line -> 340, File -> proc.c, SQLSTATE -> 53300, Routine -> InitProcess, V -> FATAL, Message -> sorry, too many clients already, Severity -> FATAL))
[error] c.g.m.a.d.p.PostgreSQLConnection - Error with message -> ErrorMessage(fields=Map(Line -> 340, File -> proc.c, SQLSTATE -> 53300, Routine -> InitProcess, V -> FATAL, Message -> sorry, too many clients already, Severity -> FATAL))
[error] c.g.m.a.d.p.PostgreSQLConnection - Error with message -> ErrorMessage(fields=Map(Line -> 779, File -> postinit.c, SQLSTATE -> 53300, Routine -> InitPostgres, V -> FATAL, Message -> remaining connection slots are reserved for non-replication superuser connections, Severity -> FATAL))
[error] c.g.m.a.d.p.PostgreSQLConnection - Error with message -> ErrorMessage(fields=Map(Line -> 779, File -> postinit.c, SQLSTATE -> 53300, Routine -> InitPostgres, V -> FATAL, Message -> remaining connection slots are reserved for non-replication superuser connections, Severity -> FATAL))
[error] c.g.m.a.d.p.PostgreSQLConnection - Error with message -> ErrorMessage(fields=Map(Line -> 779, File -> postinit.c, SQLSTATE -> 53300, Routine -> InitPostgres, V -> FATAL, Message -> remaining connection slots are reserved for non-replication superuser connections, Severity -> FATAL))
[error] c.g.m.a.d.p.PostgreSQLConnection - Error on connection
com.github.mauricio.async.db.postgresql.exceptions.GenericDatabaseException: ErrorMessage(fields=Map(Line -> 340, File -> proc.c, SQLSTATE -> 53300, Routine -> InitProcess, V -> FATAL, Message -> sorry, too many clients already, Severity -> FATAL))
at com.github.mauricio.async.db.postgresql.PostgreSQLConnection.onError(PostgreSQLConnection.scala:175)
at com.github.mauricio.async.db.postgresql.codec.PostgreSQLConnectionHandler.channelRead0(PostgreSQLConnectionHandler.scala:206)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:343)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:336)
Is there a way to configure the amount of connections in the connection pool?
I'm not really sure on how to use the connections anyway (from the documentation).
At the moment, I have a global ConnectionPool[PostgreSQLConnection] and send of queries right from it. It looks like somehow the connections get recycled after a few seconds, but before that, I just receive exceptions like above.
Should I explicitly close a connection after my work with it is done or does the connection pool handle this?
Is there a helper method like the connection.inTransaction { ... } available that would automatically close the connection?
How can I configure the maximum amount of connections to my database?
I create the connection pool like this
new ConnectionPool(factory, PoolConfiguration.Default)
When firing a lot of queries through my play 2.5 app, I get errors like these:
Is there a way to configure the amount of connections in the connection pool?
I'm not really sure on how to use the connections anyway (from the documentation).
At the moment, I have a global ConnectionPool[PostgreSQLConnection] and send of queries right from it. It looks like somehow the connections get recycled after a few seconds, but before that, I just receive exceptions like above.
I create the connection pool like this
new ConnectionPool(factory, PoolConfiguration.Default)