Skip to content

[Help] Mysql Error When Players Online Be 30-40

Featured Replies

Hello! i have a very big problem with gameserver to connect with mysql

When players online are 30-40, server crashed by mysql

i have linux and i increased to my.cnf max connected 3000.

Max online players in gameserver are 500 people.

 

this is the error

 

An exception occurred while acquiring a poolable resource. Will retry.
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection, mess$
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
at com.mysql.jdbc.Util.getInstance(Util.java:382)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1013)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1119)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2338)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2371)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2163)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:794)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
at sun.reflect.GeneratedConstructorAccessor60.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:378)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledC$
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:620)

 

 

try max connected = 400

Edited by xrulezz

can i pm you somewhere? skype, msn, facebook cause i have the same problem!

Edited by xrulezz

3000 max connections? I doubt you understand how that config works. Reduce it to 100.

 

My suggestion: rework your pack's L2DatabaseFactory and use try () - catch () to handle all your db connections. You'll also have to update your java version to 7. Java 7 handles all connections and closes them automatically.

  • Author

3000 max connections? I doubt you understand how that config works. Reduce it to 100.

 

My suggestion: rework your pack's L2DatabaseFactory and use try () - catch () to handle all your db connections. You'll also have to update your java version to 7. Java 7 handles all connections and closes them automatically.

I'm using l2jfrozen! and i have already java version 7

The main problem is we don't have the complete message error, and the reason.

 

 

 

Data source rejected establishment of connection, mess$

 

That "mess$" should be server message with the reason.

 

Java 7 handles connection close using the try (Connection...) writing style, yup.

  • Author

The main problem is we don't have the complete message error, and the reason.

 

 

That "mess$" should be server message with the reason.

 

Java 7 handles connection close using the try (Connection...) writing style, yup.

And what i have to do?

The main problem is we don't have the complete message error, and the reason.

 

 

That "mess$" should be server message with the reason.

 

Java 7 handles connection close using the try (Connection...) writing style, yup.

so what?

Edited by xrulezz

And what i have to do?

Look my post, i've written a suggestion there ;)

 

A good reference is L2JServer's latest DatabaseFactory. You can also take a look on how they handle their connections and do the same.

 

That of course is time consuming, easier solution would be to write a small piece of code to detect unclosed SQL connections.

  • Author

Look my post, i've written a suggestion there ;)

 

A good reference is L2JServer's latest DatabaseFactory. You can also take a look on how they handle their connections and do the same.

 

That of course is time consuming, easier solution would be to write a small piece of code to detect unclosed SQL connections.

and i have only to edit DatabaseFactory or i have to edit more files?

Edited by xFranky

First option requires a massive rework on every file that handles a database connection.

Second option requires a small piece of code in L2DatabaseFactory.

 

First is better performance wise, since you'll always be sure issues like that won't ever happen again.

Second will simply point you where the error comes from, enabling you to fix it.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.