List:MySQL++« Previous MessageNext Message »
From:Graham Reitz Date:November 24 2007 12:07am
Subject:Re: Application hangs at Result call to at()...
View as plain text  
Also, I receive a EXC_BAD_ACCESS, which leads me to believe I have a  
pointer that is screwed up.


On Nov 23, 2007, at 5:37 PM, Graham Reitz wrote:

> I forgot to add:
>
> Mac OS X 10.5.1 (Leopard)
> Xcode 3.0
>
> On Nov 23, 2007, at 5:34 PM, Graham Reitz wrote:
>
>> I have an application that does the following:
>>
>> unsigned int some_db::client_id_query(std::string &client_username,
>>                          std::string &client_password,
>>                          std::string &error_msg)
>> {
>> 	try
>> 	{
>>       Query client_id_query = m_connection.query();
>>       client_id_query << "select client_id from clients where  
>> client_user_name ="
>>           << quote_only << client_username << " and
> client_password  
>> ="
>>           << quote_only << client_password;
>>
>>       cout << "Query created\n";
>>
>>       Result client_id_result = client_id_query.store();
>>
>>       cout << "Result received\n";
>>
>>       Row client_id_row;
>>       if (client_id_row = client_id_result.at(0))  // It hangs  
>> here, and eventually hard crashes.
>>       {
>>           return client_id_row.at(0);
>>       }
>>   }
>>   catch (exception &e)
>>   {
>>       error_msg = e.what();
>>   }
>>   catch (...)
>>   {
>>       error_msg = "Unknown exception";
>>   }
>>   return 0;
>> }
>>
>> The output is:
>> Connected to the some database (this is from the main function)
>> Query created
>> Result received (hangs here for about 20-30 seconds and than hard  
>> crashes)
>>
>> I can perform a manual query in the database using the mysql client  
>> and it returns a result without issue.
>> What would cause it to hang for about 20-30 seconds at the  
>> client_id_result.at(0) call?
>> If there is something fundamentally wrong with this code I would be  
>> grateful for any advice.
>>
>> Thanks,
>> graham
>>
>


Thread
Application hangs at Result call to at()...Graham Reitz24 Nov
  • Re: Application hangs at Result call to at()...Graham Reitz24 Nov
    • Re: Application hangs at Result call to at()...Graham Reitz24 Nov
      • Re: Application hangs at Result call to at()...Graham Reitz24 Nov
      • Re: Application hangs at Result call to at()...Warren Young26 Nov
  • RE: Application hangs at Result call to at()...Jim Wallace26 Nov
    • Re: Application hangs at Result call to at()...Graham Reitz26 Nov