fix entries not inserted properly when no languages are detected
rollback current transaction before trying to report SQL query errors, properly save database error messages when logging query errors