This error is related to the program (InSim in this case) trying to connect to a mysql database through an already opened connection.
First, you need to be sure that you have a "connection.close()" after running your script. Otherwise, you can reach either the pool limit and get errors if another part of the code, which uses the same connection, try to open a connection.
The second thing you should consider is to do not declare the connection outside the function, as a global variable for example.
If the connection is declared outside, all parts of the code will call the SAME connection, which cannot be handled by the MySQL connector you are using.
For example, inside CNL you declare the MySQL connector:
void CNLPacket....blablabla
{
if (some.player == something)
{
MySQLConnection connection = new MySQLConnetion......
connection.open();
YOUR CODE HERE DOING SOMETHING
connection.close();
}
}
Then, if you need to call something on your database in another packet or timer, for example, you call it again for inside that function.
I tried to be clear, but tell us if you didn't understad.