What happens with threaded queries if the hDatabase (global variable) is changed with another database handle? Lets say these threaded queries are finished after the change. Are they throwing errors (with db == null or rs == null), or are finished successfully?
Example:
PHP Code:
public void OnConfigsExecuted()
{
Database.Connect(Database_OnConnect, "playeractivity");
}
public void Database_OnConnect(Database db, const char[] error, any data)
{
if (!db)
{
g_Database = null;
LogError("Could not connect to the database: %s", error);
return;
}
if (!g_Database)
{
g_Database = db;
}
else
{
if (db.IsSameConnection(g_Database))
{
delete db;
}
else
{
delete g_Database;
g_Database = db;
}
}
}
public void OnMapEnd()
{
if (!g_Database)
{
return;
}
// send threaded query here
}
Lets say the query from OnMapEnd is executed after the map change (and after the Database.Connect thing - lets say I changed the database configurations and now there's a new connection:
db.IsSameConnection(g_Database) returns false). What happens with the query?
__________________