Quote:
|
Originally Posted by mysticssjgoku4
1) What happens when an SQL connection is lost? Will data be lost from that point on?
|
The handler has a parameter (in fact it's the first one) which contains an error code. From sqlx.inc:
Code:
#define TQUERY_CONNECT_FAILED -2
#define TQUERY_QUERY_FAILED -1
#define TQUERY_SUCCESS 0
Quote:
|
Originally Posted by mysticssjgoku4
2) When multi-threading is used, does it queue queries and execute later? What happens the server crashes?
|
Yes and yes. The queries generally execute within one second. As a parent poster said, the server dying is its own problem.
Quote:
|
Originally Posted by mysticssjgoku4
3) When not using Multi-Threading, do the queries queue up?
|
Yes. It tries to semi-intelligently execute them in another thread. It may sleep very shortly between execution, but in general if you make, say, 50 multithread queries at once, it will take only a few seconds to resolve them all.
Quote:
|
Originally Posted by mysticssjgoku4
4) Is there a precise or estimated server advantage of using this over DBI?
|
This was originally developed for
ESportsEA where I work (different code, same idea). We have servers all over the country, and one database server in Texas. Users have to pay to play on the servers, so we have server-side authentication.
Imagine the case of someone connecting and everyone in the server "blipping" because the DB took a few extra milliseconds to query. It got pretty bad and we moved to multithreading.
Another example is the Official Server for AMX Mod X (the NFo one). The server is located in NY and our db server is in Texas, so it threads queries as to not interrupt gameplay. I'm pretty sure NFo also uses custom SQLx threading stuff on their servers.
If your DB and server are close together, it's not necessary. But if you're catering to situations like the ones I described, it's a godsend.
__________________