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

[help required] database connection problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fragnichtnach
AlliedModders Donor
Join Date: Oct 2008
Old 06-03-2021 , 04:00   [help required] database connection problem
Reply With Quote #1

Setup:
Consider a server with two plugins. Both connected to different databases. The two databases are running on different IPs.

Problem:
If one database is offline (and the IP unreachable) both plugins are having problems with loading.
  • I'm search a solution how it's possible to have the two plugins running independent. So problems with one database doesn't effect the plugin running on another database.
  • In case this isn't possible in general: Is it possible to make one plugin loading prior to other plugins so that this plugion is loading no matter if there are problems with other database plugins?
  • In case this should be possible: Is there a open source plugin where the database handling is done correctly so that this doesn't happen?

Thanks for your help in advance.
fragnichtnach is offline
canadianjeff
BANNED
Join Date: Sep 2016
Old 06-06-2021 , 18:27   Re: [help required] database connection problem
Reply With Quote #2

your problem does not actually make logical sense

plugin 1 connects to database A
plugin 2 connects to database B

plugin 1 should not have issues with plugin 2 and plugin 2 should not interfere with plugin 1

configs/databases.cfg should look something like this??

Code:
"Databases"
{
	"driver_default"		"mysql"
	
	// When specifying "host", you may use an IP address, a hostname, or a socket file path
	
	"default"
	{
		"driver"			"default"
		"host"				"127.0.0.1"
		"database"			"DBNAME"
		"user"				"DBUSER"
		"pass"				"DBPASS"
		//"timeout"			"0"
		//"port"			"0"
	}
	
	"storage-local"
	{
		"driver"			"sqlite"
		"database"			"sourcemod-local"
	}

	"clientprefs"
	{
		"driver"			"sqlite"
		"host"				"localhost"
		"database"			"clientprefs-sqlite"
		"user"				"root"
		"pass"				""
		//"timeout"			"0"
		//"port"			"0"
	}

	"databaseA"
	{
		"driver" "default"
		"host"				"127.0.0.1"
		"database"			"DBNAME_A"
		"user"				"DBUSER_A"
		"pass"				"DBPASS_A"
	}

	"databaseB"
	{
		"driver" "default"
		"host"				"127.0.0.1"
		"database"			"DBNAME_B"
		"user"				"DBUSER_B"
		"pass"				"DBPASS_B"
	}
}

Last edited by canadianjeff; 06-06-2021 at 18:28.
canadianjeff is offline
Reply


Thread Tools
Display Modes

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:26.


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