List:MySQL++« Previous MessageNext Message »
From:Alexis Rodriguez Castedo Date:June 2 2008 12:13pm
Subject:Re: mysqlpp::Query Issue
View as plain text  

Try mutex instead critical section, mutexes have the advantage that can be 
accessed by the threads of different processes. Critical section is often used 
to protect a shared resource in order to synchronize the access order and (one 
of the most important restriction for me) you cannot have a wait with a timeout 
like mutex or semaphore,

Best regards,


----- Original Message ----- 
From: "Warren Young" <mysqlpp@stripped>
To: "MySQL++ Mailing List" <plusplus@stripped>
Sent: Monday, June 02, 2008 11:00 AM
Subject: Re: mysqlpp::Query Issue

> onlyreply-sql@stripped wrote:
>> I think the problem was with
>> default constructor on query object not properly being initialized.
>> Once I  initialized sqlquery object like this ... mysqlpp::Query
>> sqlquery = commonDBCon.query(); , the problem went away
> Are you saying that it doesn't work when you pass the query string to 
> Connection::query()?  The examples do this in several places successfully, and 
> this is an intended feature, so if you can show an instance where it doesn't 
> work, I'd be interested in seeing compilable code that shows it.
>>             LeaveCriticalSection(&m_csDBAccess);
> Not MySQL++ related, but this is highly error-prone code.  You should be using 
> an RAII pattern here to make sure that all code paths that exit the function 
> release the critical section mutex.  It appears fine now, but future 
> maintenance could add a code path that accidentally doesn't release the mutex. 
> See the code for MySQL++'s Transaction class -- it's short -- for the general 
> idea.
> -- 
> MySQL++ Mailing List
> For list archives:
> To unsubscribe: 

MySQL example codejupiter.hce29 May
  • Re: MySQL example codeWarren Young29 May
  • mysqlpp::Query Issueonlyreply-sql1 Jun
    • Re: mysqlpp::Query IssueWarren Young2 Jun
Re: mysqlpp::Query Issueonlyreply-sql2 Jun
  • Re: mysqlpp::Query IssueWarren Young2 Jun
  • Re: mysqlpp::Query IssueAlexis Rodriguez Castedo2 Jun
Re: mysqlpp::Query Issuebsingh3 Jun