Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => PostgreSQL and SQLite Support => Topic started by: w5hro on April 05, 2014, 01:24:33 PM

Title: Error after SQLite 3 Modification
Post by: w5hro on April 05, 2014, 01:24:33 PM
After running the modification found here: http://custom.simplemachines.org/mods/index.php?mod=3448 (http://custom.simplemachines.org/mods/index.php?mod=3448) to convert my database to SQLite 3 I'm getting the occasional error below. My SQLite version is 3.3.6

Notice: Undefined variable: err_msg in /home/mylocation/public_html/Sources/Subs-Db-sqlite3.php on line 374 database is locked

Not sure what that is, but if I look at line 374 I see some code above and below it that looks like it might be some kind of delay or overload timing for the database connection. Any idea what that is and how to correct it? If I hit the back arrow on my browser and then go there again the problem is gone.

Line 374 is: $ret = smf_db_error($db_string . '#!#' . $err_msg, $connection);

$st = microtime();
// Don't overload it.
$db_cache[$db_count]['q'] = $db_count < 50 ? $db_string : '...';
$db_cache[$db_count]['f'] = $file;
$db_cache[$db_count]['l'] = $line;
$db_cache[$db_count]['s'] = array_sum(explode(' ', $st)) - array_sum(explode(' ', $time_start));
}

$ret = @$connection->query($db_string);
if ($ret === false && empty($db_values['db_error_skip']))
$ret = smf_db_error($db_string . '#!#' . $err_msg, $connection);

// Debugging.
if (isset($db_show_debug) && $db_show_debug === true)
$db_cache[$db_count]['t'] = array_sum(explode(' ', microtime())) - array_sum(explode(' ', $st));

return $ret;
}
Title: Re: Error after SQLite 3 Modification
Post by: margarett on April 05, 2014, 06:37:24 PM
That is strange, yes, but that only occurs if there was a connection problem, as it comes from the "if" above. So you should probably remove the @ from @$connection above so that the real error is revealed.

Anyway, that's seems a legit issue in the MOD but you need to address it in the respective support topic...
Title: Re: Error after SQLite 3 Modification
Post by: w5hro on April 05, 2014, 09:46:12 PM
Quote from: margarett on April 05, 2014, 06:37:24 PM
That is strange, yes, but that only occurs if there was a connection problem, as it comes from the "if" above. So you should probably remove the @ from @$connection above so that the real error is revealed.

Anyway, that's seems a legit issue in the MOD but you need to address it in the respective support topic...

Thanks I will note that and will try it next if necessary. One thing I did earlier today was enable the Load Balancing feature. Since doing so I've only seen the error one time. It made things a bit tighter and it disabled searches about 50% of the time so I bumped up the default numbers by .5 except for the last line. I changed it from 40.0 to 50.0. See the attachment below. I have not seen the error since changing that last line to 50.0 but I don't want to speak too soon. I need to wait and see if it comes back again.

This is just a wild guess, but is there anyway the 50 in the line below has anything to do with it?

$db_cache[$db_count]['q'] = $db_count < 50 ? $db_string : '...';
Title: Re: Error after SQLite 3 Modification
Post by: w5hro on April 06, 2014, 03:33:02 PM
This topic is being continued here: http://www.simplemachines.org/community/index.php?topic=486466.msg3406465#msg3406465 (http://www.simplemachines.org/community/index.php?topic=486466.msg3406465#msg3406465)