No Code Attached Yet Information Required bug
avatar dvince38
dvince38
16 Nov 2021

Steps to reproduce the issue

here is my code which works very well, but if the 'dbserver' server does not respond, joomla does not work either and displays the error 2002 :

		$option=array();
		$option['driver']   = 'mysqli';            // Database driver name
		$option['host']     = 'dbserver';    // Database Host name
		$option['user']     = 'login';       // User for database authentication
		$option['password'] = 'password';   // Password for database authentication
		$option['database'] = 'db';      // Database name
		$option['prefix']   = '';             // Database prefix (may be empty)
		$db=JDatabaseDriver::getInstance($option);

		try {
			$db->transactionStart();
			$db->setUTF();

			$query=$db->getQuery(true);
			$query->select('*');
			$query->from($db->quoteName('status'));
			
			$db->setQuery($query);
			$result = $db->execute();
			if($result===false)
				$db->transactionRollback();
			else
			{
				$db->transactionCommit();
				$liste=$db->loadAssocList();
				...
			}
		}
		catch (Exception $e) {
			$db->transactionRollback();
		}

I tried adding a "try/catch" and a "transaction" to handle the error, but it doesn't change anything.

Expected result

that errors can be managed

Actual result

the site is down

System information (as much as possible)

Joomla 4.0.4

Additional comments

avatar dvince38 dvince38 - open - 16 Nov 2021
avatar joomla-cms-bot joomla-cms-bot - change - 16 Nov 2021
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 16 Nov 2021
avatar HLeithner HLeithner - change - 16 Nov 2021
The description was changed
avatar HLeithner HLeithner - edited - 16 Nov 2021
avatar brianteeman
brianteeman - comment - 6 Apr 2022

Did you resolve this?

avatar Quy Quy - change - 6 Apr 2022
Labels Added: Information Required
avatar Quy Quy - change - 6 Apr 2022
Labels Added: Information Required
avatar Quy Quy - change - 6 Apr 2022
Labels Added: Information Required
avatar Quy Quy - labeled - 6 Apr 2022
avatar Quy Quy - labeled - 6 Apr 2022
avatar Quy Quy - labeled - 6 Apr 2022
avatar Quy Quy - labeled - 6 Apr 2022
avatar dvince38
dvince38 - comment - 6 Apr 2022

no, it is not resolved

avatar Hackwar Hackwar - change - 22 Feb 2023
Labels Added: bug
avatar Hackwar Hackwar - labeled - 22 Feb 2023
avatar brianteeman brianteeman - close - 31 Aug 2023
avatar brianteeman brianteeman - change - 31 Aug 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-08-31 10:17:33
Closed_By brianteeman
avatar brianteeman
brianteeman - comment - 31 Aug 2023

I am closing this as it relates to custom code and the original reporter is no longer using github so they wont see any responses.

Add a Comment

Login with GitHub to post a comment