List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:June 2 2008 9:00am
Subject:Re: mysqlpp::Query Issue
View as plain text  
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.
Thread
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