List:MySQL++« Previous MessageNext Message »
From:Joel Fielder Date:January 8 2010 10:20am
Subject:mysqlpp::ScopedConnection
View as plain text  
Hi Warren,

I've got a useful class which I use a lot when dealing with a connection 
pool, for example:

mysqlpp::ScopedConnection connection(pool);
mysqlpp::Query query(connection->query());
query << "SELECT 1";
query.execute();

It grabs the connection on construction and releases upon destruction, 
but it also provides operator->() so you can treat it as if it were a 
pointer to a Connection.

Would you like a patch?  If so, where would be an appropriate place in 
the library and are there any other gotchas?

Joel
Thread
Query::execute crashes without a connected driverJoel Fielder7 Jan
  • Re: Query::execute crashes without a connected driverWarren Young7 Jan
    • Re: Query::execute crashes without a connected driverJoel Fielder8 Jan
    • mysqlpp::ScopedConnectionJoel Fielder8 Jan
      • Re: mysqlpp::ScopedConnectionWarren Young9 Jan
        • Re: mysqlpp::ScopedConnectionJonathan Wakely9 Jan
          • Re: mysqlpp::ScopedConnectionJoel Fielder11 Jan
            • Re: mysqlpp::ScopedConnectionJonathan Wakely11 Jan
              • Re: mysqlpp::ScopedConnectionWarren Young11 Jan
                • Re: mysqlpp::ScopedConnectionJonathan Wakely11 Jan
    • Re: Query::execute crashes without a connected driverJoel Fielder13 Jan
      • Re: Query::execute crashes without a connected driverWarren Young13 Jan
Re: mysqlpp::ScopedConnectionJoel Fielder11 Jan
  • Re: mysqlpp::ScopedConnectionWarren Young11 Jan
    • Re: mysqlpp::ScopedConnectionJoel Fielder11 Jan
      • Re: mysqlpp::ScopedConnectionWarren Young11 Jan
        • Re: mysqlpp::ScopedConnectionJoel Fielder12 Jan