Unclosed connections
Forum rules
READ NOW: L2j Forums Rules of Conduct
READ NOW: L2j Forums Rules of Conduct
- qwerty13
- Posts: 640
- Joined: Mon Feb 02, 2009 9:57 am
- Location: Europe
- Contact:
Re: Unclosed connections
Htmls and icons in .py - this is sad.
- Stake
- Posts: 383
- Joined: Sun Mar 23, 2008 9:33 pm
- Location: Hungary
- Contact:
Re: Unclosed connections
Yeah, always makes us cry.qwerty13 wrote:Htmls and icons in .py - this is sad.


- Naonah
- Posts: 357
- Joined: Sun Apr 04, 2010 11:12 pm
Re: Unclosed connections
Well, I tested more this crap
so...
When I have this setting like: ENABLE_SCHEME_SYSTEM = False , all is OK - all connections are closed, no errors.
..but when I set this to TRUE , I have spam of unclosed connections and mysgl error, lol - so the problem is only under this condition.
Please help me with this damn Python
cuz I have no idea what to do
Thank you.

so...
When I have this setting like: ENABLE_SCHEME_SYSTEM = False , all is OK - all connections are closed, no errors.
..but when I set this to TRUE , I have spam of unclosed connections and mysgl error, lol - so the problem is only under this condition.
Please help me with this damn Python


Thank you.
public void l2jserver ()
{
if (you want l2j server == no problems)
use Linux;
else
use Windows;
}
{
if (you want l2j server == no problems)
use Linux;
else
use Windows;
}
- janiii
- L2j Veteran
- Posts: 4269
- Joined: Wed May 28, 2008 3:15 pm
- Location: Slovakia
Re: Unclosed connections
these event dont close connections:
if event == "create" :
if event == "remove_buff" :
if event == "create" :
if event == "remove_buff" :
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper ♀
I don't give private support - PM will be ignored!
forum flOOder dancing dEVILoper ♀
I don't give private support - PM will be ignored!
- Naonah
- Posts: 357
- Joined: Sun Apr 04, 2010 11:12 pm
Re: Unclosed connections
This script looks now: http://pastebin.com/qMEHW9cxjaniii wrote:these event dont close connections:
if event == "create" :
if event == "remove_buff" :
and still... unclosed connections. Maybe I do something wrong? I give up

Code: Select all
2010-10-10 23:43:55 com.l2jserver.L2DatabaseFactory$ConnectionCloser runWARNING: Unclosed connection! Trace: sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)java.lang.RuntimeException at com.l2jserver.L2DatabaseFactory.getConnection(L2DatabaseFactory.java:227) at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.python.core.PyReflectedFunction.__call__(Unknown Source) at org.python.core.PyMethod.__call__(Unknown Source) at org.python.core.PyObject.__call__(Unknown Source) at org.python.core.PyInstance.invoke(Unknown Source) at org.python.pycode.serializable._pyx1286746889859.onAdvEvent$14(__init__.py:788) at org.python.pycode.serializable._pyx1286746889859.call_function(__init__.py) at org.python.core.PyTableCode.call(Unknown Source) at org.python.core.PyTableCode.call(Unknown Source) at org.python.core.PyTableCode.call(Unknown Source) at org.python.core.PyFunction.__call__(Unknown Source) at org.python.core.PyMethod.__call__(Unknown Source) at org.python.core.PyObject.__call__(Unknown Source) at org.python.core.PyObject._jcallexc(Unknown Source) at org.python.core.PyObject._jcall(Unknown Source) at org.python.proxies.main$Quest$12.onAdvEvent(Unknown Source) at com.l2jserver.gameserver.model.quest.Quest.notifyEvent(Quest.java:447) at com.l2jserver.gameserver.model.actor.instance.L2PcInstance.processQuestEvent(L2PcInstance.java:1822) at com.l2jserver.gameserver.network.clientpackets.RequestBypassToServer.runImpl(RequestBypassToServer.java:221) at com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:62) at com.l2jserver.gameserver.network.L2GameClient.run(L2GameClient.java:973) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619)
public void l2jserver ()
{
if (you want l2j server == no problems)
use Linux;
else
use Windows;
}
{
if (you want l2j server == no problems)
use Linux;
else
use Windows;
}
- Naonah
- Posts: 357
- Joined: Sun Apr 04, 2010 11:12 pm
Re: Unclosed connections
Sry for double post but I think I am close to solve this
I lost half a day for this crap script and reworked it.
Here this script: http://pastebin.com/juRHcDkF
...but I have this mysql error:( Can you tell me what is wrong here? Thank you.
Best regards.

I lost half a day for this crap script and reworked it.
Here this script: http://pastebin.com/juRHcDkF
...but I have this mysql error:( Can you tell me what is wrong here? Thank you.
Code: Select all
C:\Documents and Settings\bolo.LOL-805AA799D1C\Pulpit\ServerFreya\gameserver\data\scripts\custom\555_buffer\__init__.pyTraceback (innermost last): (no code object) at line 0 at sun.reflect.GeneratedConstructorAccessor92.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:409) at com.mysql.jdbc.Util.getInstance(Util.java:384) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2113) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2275) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76) at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntaxto use near ') ORDER BY buff_class ASC' at line 1 at org.python.core.Py.JavaError(Unknown Source) at org.python.core.PyObject._jthrow(Unknown Source) at org.python.core.PyObject._jcall(Unknown Source) at org.python.proxies.main$Quest$21.onAdvEvent(Unknown Source) at com.l2jserver.gameserver.model.quest.Quest.notifyEvent(Quest.java:447) at com.l2jserver.gameserver.model.actor.instance.L2PcInstance.processQuestEvent(L2PcInstance.java:1822) at com.l2jserver.gameserver.network.clientpackets.RequestBypassToServer.runImpl(RequestBypassToServer.java:221) at com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:62) at com.l2jserver.gameserver.network.L2GameClient.run(L2GameClient.java:973) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Traceback (innermost last): (no code object) at line 0 at sun.reflect.GeneratedConstructorAccessor92.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:409) at com.mysql.jdbc.Util.getInstance(Util.java:384) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2113) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2275) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76) at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntaxto use near ') ORDER BY buff_class ASC' at line 1
public void l2jserver ()
{
if (you want l2j server == no problems)
use Linux;
else
use Windows;
}
{
if (you want l2j server == no problems)
use Linux;
else
use Windows;
}
- SolidSnake
- Posts: 865
- Joined: Wed Jan 20, 2010 6:54 pm
- Location: Italy
- Naonah
- Posts: 357
- Joined: Sun Apr 04, 2010 11:12 pm
Re: Unclosed connections
I did all what you wrote and still the same:/ It is crazySolidSnake wrote:http://l2jserver.com/forum/viewtopic.ph ... =0#p100143

Please have a look and tell me where is error http://pastebin.com/c1xpkRh8
And here error:
Code: Select all
Unclosed connection! Trace: sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)java.lang.RuntimeException at com.l2jserver.L2DatabaseFactory.getConnection(L2DatabaseFactory.java:227) at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.python.core.PyReflectedFunction.__call__(Unknown Source) at org.python.core.PyMethod.__call__(Unknown Source) at org.python.core.PyObject.__call__(Unknown Source) at org.python.core.PyInstance.invoke(Unknown Source) at org.python.pycode.serializable._pyx1286804555000.onAdvEvent$14(__init__.py:708) at org.python.pycode.serializable._pyx1286804555000.call_function(__init__.py) at org.python.core.PyTableCode.call(Unknown Source) at org.python.core.PyTableCode.call(Unknown Source) at org.python.core.PyTableCode.call(Unknown Source) at org.python.core.PyFunction.__call__(Unknown Source) at org.python.core.PyMethod.__call__(Unknown Source) at org.python.core.PyObject.__call__(Unknown Source) at org.python.core.PyObject._jcallexc(Unknown Source) at org.python.core.PyObject._jcall(Unknown Source) at org.python.proxies.main$Quest$15.onAdvEvent(Unknown Source) at com.l2jserver.gameserver.model.quest.Quest.notifyEvent(Quest.java:447) at com.l2jserver.gameserver.model.actor.instance.L2PcInstance.processQuestEvent(L2PcInstance.java:1822) at com.l2jserver.gameserver.network.clientpackets.RequestBypassToServer.runImpl(RequestBypassToServer.java:221) at com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:62) at com.l2jserver.gameserver.network.L2GameClient.run(L2GameClient.java:973) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619)
public void l2jserver ()
{
if (you want l2j server == no problems)
use Linux;
else
use Windows;
}
{
if (you want l2j server == no problems)
use Linux;
else
use Windows;
}
- SolidSnake
- Posts: 865
- Joined: Wed Jan 20, 2010 6:54 pm
- Location: Italy
Re: Unclosed connections
So you're using another buffer's version.. I have the Rin4a's epilogue scheme buffer and I solved this problem with those lines... There is another error for 'create' command at line 708
Last edited by SolidSnake on Mon Oct 11, 2010 2:08 pm, edited 1 time in total.

-
- Posts: 484
- Joined: Sat Jan 23, 2010 4:42 pm
Re: Unclosed connections
Solved it for me too if I remember right.^^SolidSnake wrote:So you're using another buffer's version.. I have the Rin4a's epilogue scheme buffer and I solved this problem with those lines
Last edited by Starter on Tue Oct 12, 2010 2:25 pm, edited 2 times in total.
I have promises to keep and miles to go before I sleep.
- Naonah
- Posts: 357
- Joined: Sun Apr 04, 2010 11:12 pm
Re: Unclosed connections
Finally fixed.
You helped me a lot so I have to share this strange solution.
..so called double closing helped, lol. This python is cool
Special thx to SolidSnake.
closed
You helped me a lot so I have to share this strange solution.
Code: Select all
if event == "create" : con=L2DatabaseFactory.getInstance().getConnection() param = eventParam1.replace("."," ") if param == "no_name" : return showText(st,"Info","Please, enter the scheme name!","True","Return","main") else : ins=con.prepareStatement("INSERT INTO buffer_scheme_list (player_id,scheme_name) VALUES (?,?)") ins.setString(1, str(st.player.getObjectId())) ins.setString(2, param) try : ins.executeUpdate() ins.close() con.close() L2Databasefactory.close(con) except : pass return rebuildMainHtml(st)

Special thx to SolidSnake.
closed
public void l2jserver ()
{
if (you want l2j server == no problems)
use Linux;
else
use Windows;
}
{
if (you want l2j server == no problems)
use Linux;
else
use Windows;
}
- Stake
- Posts: 383
- Joined: Sun Mar 23, 2008 9:33 pm
- Location: Hungary
- Contact:
Re: Unclosed connections
Because you opened multiple connections (con, conn). Only 1 connection would be enough for the entire script.Naonah wrote:..so called double closing helped, lol. This python is cool


- Naonah
- Posts: 357
- Joined: Sun Apr 04, 2010 11:12 pm
Re: Unclosed connections
Could not you tell me that before?Stake wrote:
Because you opened multiple connections (con, conn). Only 1 connection would be enough for the entire script.

Anyway I thank you too.
public void l2jserver ()
{
if (you want l2j server == no problems)
use Linux;
else
use Windows;
}
{
if (you want l2j server == no problems)
use Linux;
else
use Windows;
}
-
- Posts: 484
- Joined: Sat Jan 23, 2010 4:42 pm
Re: Unclosed connections
What about this:Naonah wrote:Finally fixed.
You helped me a lot so I have to share this strange solution.
..so called double closing helped, lol. This python is coolCode: Select all
if event == "create" : con=L2DatabaseFactory.getInstance().getConnection() param = eventParam1.replace("."," ") if param == "no_name" : return showText(st,"Info","Please, enter the scheme name!","True","Return","main") else : ins=con.prepareStatement("INSERT INTO buffer_scheme_list (player_id,scheme_name) VALUES (?,?)") ins.setString(1, str(st.player.getObjectId())) ins.setString(2, param) try : ins.executeUpdate() ins.close() con.close() L2Databasefactory.close(con) except : pass return rebuildMainHtml(st)
![]()
Special thx to SolidSnake.
closed
Code: Select all
if event == "create" : conn = L2DatabaseFactory.getInstance().getConnection() param = eventParam1.replace("."," ") if param == "no_name" : return showText(st,"Info","Please, enter the scheme name!","True","Return","main") else : ins = conn.prepareStatement("INSERT INTO buffer_scheme_list (player_id,scheme_name) VALUES (?,?)") ins.setString(1, str(st.player.getObjectId())) ins.setString(2, param) try : ins.executeUpdate() ins.close() conn.close() except : try : conn.close() except : pass return rebuildMainHtml(st)
I have promises to keep and miles to go before I sleep.
- Naonah
- Posts: 357
- Joined: Sun Apr 04, 2010 11:12 pm
Re: Unclosed connections
I tried this and got syntax error, lol. Only this construction I wrote as last works 

public void l2jserver ()
{
if (you want l2j server == no problems)
use Linux;
else
use Windows;
}
{
if (you want l2j server == no problems)
use Linux;
else
use Windows;
}