Jump to content

Question

Posted

Καλησπέρα  σας,

Παρακαλώ την βοήθεια σας με το παρακάτω μήνυμα, ο server σταματάει  (L2J H5)  και προσπαθώ να βρω τι το προκαλεί :

 

[28/05 02:26:52] BoneCPConnectionFactory: Unable to get a connection!
java.sql.SQLException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at com.jolbox.bonecp.PoolUtil.generateSQLException(PoolUtil.java:192)
    at com.jolbox.bonecp.DefaultConnectionStrategy.getConnectionInternal(DefaultConnectionStrategy.java:95)
    at com.jolbox.bonecp.AbstractConnectionStrategy.getConnection(AbstractConnectionStrategy.java:90)
    at com.jolbox.bonecp.BoneCP.getConnection(BoneCP.java:552)
    at com.jolbox.bonecp.BoneCPDataSource.getConnection(BoneCPDataSource.java:131)
    at com.l2jserver.commons.database.pool.IConnectionFactory.getConnection(IConnectionFactory.java:60)
    at com.l2jserver.gameserver.model.variables.PlayerVariables.storeMe(PlayerVariables.java:90)
    at com.l2jserver.gameserver.model.actor.instance.L2PcInstance.store(L2PcInstance.java:7160)
    at com.l2jserver.gameserver.model.actor.instance.L2PcInstance.storeMe(L2PcInstance.java:7174)
    at com.l2jserver.gameserver.model.actor.instance.L2PcInstance.deleteMe(L2PcInstance.java:10806)
    at com.l2jserver.gameserver.network.L2GameClient$CleanupTask.run(L2GameClient.java:917)
    at com.l2jserver.gameserver.ThreadPoolManager$RunnableWrapper.run(ThreadPoolManager.java:89)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)


Caused by: java.lang.InterruptedException
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(Unknown Source)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(Unknown Source)
    at java.util.concurrent.LinkedBlockingQueue.poll(Unknown Source)
    at com.jolbox.bonecp.DefaultConnectionStrategy.getConnectionInternal(DefaultConnectionStrategy.java:82)
    ... 17 more

6 answers to this question

Recommended Posts

  • 0
Posted (edited)

λογικά ή έχεις κάποιο κακό feature που κάνει πολλά db connections ή έχεις κάνει αρκετά limit τα db connections σου

Edited by Zake
  • 0
Posted

Καλησπέρα,

 

# The time before a database connection closes (in milliseconds)
# If a query takes longer to execute than the time defined here, the server will throw "Unclosed Connection!" error.
# If you get often this error message, try increasing this.
# Default: 60000ms
ConnectionCloseTime = 120000

 

Feature αρκετά , μπορώ να πάρω μια αναφορά τι και κάθε πότε πραγματοποιεί σύνδεση με την βάση ?

  • 0
Posted (edited)

Generally due to connection leak, due to badly written custom code. Use the try-with-resources statement whenever you open a connection.

 

https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html

 

The other possibility being, you try to save all Players variables (custom variables) in a single loop, making the connection pool dry instantly. In that case, write your own version of storeMe which use only one connection and addBatch/executeBatch.

Edited by Tryskell
  • Thanks 1
  • 0
Posted

Ευχαριστώ το πρόβλημα λύθηκε.

 

Ενεργοποίησα την επιλογή 

<property name="closeConnectionWatch">true</property>

 

στο αρχείο :

/libs/bonecp-0.8.1.RELEASE.jar

 

και ανέφερε λεπτομέρειες για το σφάλμα που βοήθησαν να βρω το script που δεν έκλεινε τα connections που έκανε στην βάση.

Guest
This topic is now closed to further replies.
×
×
  • Create New...