2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 14:05:33 +00:00

[4281] Addressed further review comments.

- Always invoke mysql_insert_id to retrieve host_id value
- exit if connection with  MySql database is lost
This commit is contained in:
Marcin Siodelski
2016-05-30 11:30:26 +02:00
parent 6efa4faf3a
commit 61ca023498
4 changed files with 77 additions and 74 deletions

View File

@@ -593,23 +593,7 @@ private:
/// @brief Check Error and Throw Exception
///
/// Virtually all MySQL functions return a status which, if non-zero,
/// indicates an error. This function centralizes the error checking
/// code.
///
/// It is used to determine whether or not the function succeeded, and
/// in the event of failures, decide whether or not those failures are
/// recoverable.
///
/// If the error is recoverable, the method will throw a DbOperationError.
/// In the error is deemed unrecoverable, such as a loss of connectivity
/// with the server, this method will log the error and call exit(-1);
///
/// @todo Calling exit() is viewed as a short term solution for Kea 1.0.
/// Two tickets are likely to alter this behavior, first is #3639, which
/// calls for the ability to attempt to reconnect to the database. The
/// second ticket, #4087 which calls for the implementation of a generic,
/// FatalException class which will propagate outward.
/// This method invokes @ref MySqlConnection::checkError.
///
/// @param status Status code: non-zero implies an error
/// @param index Index of statement that caused the error