Jump to content
  • 0

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


Question

Posted

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)

 

 

11 answers to this question

Recommended Posts

  • 0
Posted

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.

  • 0
Posted

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

  • 0
Posted

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.

  • 0
Posted

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?

  • 0
Posted (edited)

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
  • 0
Posted

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.

  • 0
Posted (edited)

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
  • 0
Posted

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

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Some new features that we added: - 2 new quests - PvP Arena (to get hero status) Olympiad is disabled - Love Event - Dressme for armor/weapons/accessories - HWID Protection - More monsters - New farm zone - New autofarm system (works almost like adrenaline) - Auto enchant - Auto augment - 3 levels of armors - 3 levels of weapons - Anti KS System - Rebirth Manager - 30 days checking rewards - Small event (daily checking with small reward for all online players)
    • Added FloodProtector utility to prevent packet flooding for actions like item use and dice rolling. Integrated flood protection checks in relevant client packet handlers and registered/removal hooks in player lifecycle. Updated movement logic in L2PcInstance for improved position synchronization and geodata handling. Minor fixes and refactoring in attack logic, private store handling, and admin NPC editing. Refactored AI classes to enhance movement, attack, and skill usage logic for characters and mobs. Improved distance checks, attack range calculations, and skill casting conditions. Removed unused intention command logic from L2CharacterAI. Updated configuration to enable CellPathFinding. Minor code cleanups and bug fixes for more reliable AI behavior. Enhanced GeoPathFinding with detailed debug and error messages for region loading, including success/failure counts and file checks. Refactored L2AttackableAI and L2CharacterAI to improve attack range tolerance, immediate attack behavior, and added safety checks for missing targets. Updated configuration to disable CellPathFinding by default and added a new ShowRedName option for aggressive mobs. Minor config and log updates included. Applied TCP socket optimizations (e.g., TCP_NODELAY, buffer sizes, keepalive) in ClientThread, Connection, and SelectorThread to reduce latency and improve throughput. Enhanced L2AttackableAI with better random walk, aggro, and attack logic, including silent move checks, quest monster handling, and improved faction/raid/minion behavior. Added silent move support to L2PlayableInstance and quest monster flag to L2NpcTemplate/L2NpcInstance. These changes aim to improve server responsiveness, AI realism, and overall stability.
    • I’ve been using this Escape from Tarkov Hack for about a week now with no issues at all. ESP works great without any lag, and the aimbot is smooth and doesn't feel obvious. Had a quick setup with the loader, and support answered my questions right away. The HWID spoofer also did its job without messing with my system. So far, the cheat's staying undetected on my side.
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock