Raised This Month: $ Target: $400
 0% 

SQLX Multi-Threaded Questions.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BAILOPAN
Join Date: Jan 2004
Old 07-09-2006 , 17:06   Re: SQLX Multi-Threaded Questions.
Reply With Quote #1

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.
__________________
egg
BAILOPAN is offline
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 07-10-2006 , 17:30   Re: SQLX Multi-Threaded Questions.
Reply With Quote #2

Alright, thank you all. Your responses were very helpful.
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:55.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode