Raised This Month: $51 Target: $400
 12% 

TConnect Question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Starbish
AlliedModders Donor
Join Date: Oct 2011
Location: South Korea
Old 11-24-2014 , 22:59   TConnect Question
Reply With Quote #1

why many of the plugins call SQL_TConnect on every map change?

is it needed to get working well?

i think once is enough to get that function work..
__________________
Starbish is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 11-25-2014 , 04:53   Re: TConnect Question
Reply With Quote #2

In which plugins ?

Yes, you are right about connecting once to database, then make those necessary things you like.
If connect multiple times in database withouth closing previous ones, it will leave many "open" connections to mysql. (until unload that specific plugin)

Depends plugin activity, it's maybe better connect temporary to dataabse and close it:
connect to database -> use/query/update etc. etc. -> close database connection.
- This should make sure, you are or not getting connection to that database. Never know what block you out.

...than connect once on plugin load and keep it open that same connection all the time:
plugin load connect db -> use/query/update etc. etc. -> plugin unload close db
- Now if connection suddenly lost to database, your plugin start getting errors.
Bacardi is offline
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 12:28.


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