Hi,
everytime i open a room threads aumented of 1 unit and never decrease.
I use javascript serverside code.
use 1 scheduler that close when destroy the room.
i declare olso var dbMan = getParentZone().getDBManager();
i must destroy olso "dbMan"?
if yes in Destroy function how can i do this.
Destroy(dbMan); // is error
dbMan.cancel ; //is not a function
How can do it?
Every time i use a connection use this code is correct?
var connection = dbMan.getConnection();
var stmt = connection.prepareStatement("UPDATE utenti SET vinte2=vinte2+"+V+",perse2=perse2+"+P+",pareggiate2=pareggiate2+"+PP+",abbandoni=abbandoni+"+A+" WHERE user='"+P1+"'");
var result = stmt.executeUpdate();
if (stmt != null){
stmt.close();
}
if (connection != null){
connection.close();
}
T's
Thread
Re: Thread
Hi,
if every Room Extension starts a new Scheduler, then the thread count is expected to increase with every new Room.
The only problem is making sure to remove it in the destroy() method of your Room Extension, like this:
The true parameter forces the Scheduler to stop immediately. If you don't pass it, the scheduler will be destroyed when all the Tasks in its queue have been processed.
No, you don't need to destroy this.
Cheers
if every Room Extension starts a new Scheduler, then the thread count is expected to increase with every new Room.
The only problem is making sure to remove it in the destroy() method of your Room Extension, like this:
Code: Select all
function destroy()
{
scheduler.destroy(null);
}
The true parameter forces the Scheduler to stop immediately. If you don't pass it, the scheduler will be destroyed when all the Tasks in its queue have been processed.
i declare olso var dbMan = getParentZone().getDBManager();
i must destroy olso "dbMan"?
No, you don't need to destroy this.
Cheers
Re: Thread
thank's it works
Who is online
Users browsing this forum: No registered users and 36 guests