List:MySQL++« Previous MessageNext Message »
From:Tim Murison Date:April 11 2005 9:21pm
Subject:RE: Transactions with MySQLPP
View as plain text  
On Tue, 2005-05-04 at 07:52 -0700, Steve Roberts wrote:
> However, the underlying SQL itself will support transactions:
> 
> query << "START TRANSACTION";
> query.execute();
> query.reset();
> query << // your update here
> query.execute();
> query.reset();
> query << "COMMIT"
> query.execute(); 

Thanks... I went with this method...

At first it seemed to work but when running my program through a full
test suite, I noticed that I got failed transactions.
One in particular has me stumped, it fails on a foreign key
constraint... the perculiar thing is that if I manually enter the same
queries through the command line, it works!

The only thing I notice that your example does that I don't is
query.reset() instead of creating a new query each time... could this be
significant?

Cheers,

-Tim

Thread
Transactions with MySQLPPTim Murison5 Apr
  • Re: Transactions with MySQLPPWarren Young5 Apr
    • Re: Transactions with MySQLPPWarren Young5 Apr
RE: Transactions with MySQLPPSteve Roberts5 Apr
  • Re: Transactions with MySQLPPWarren Young5 Apr
  • RE: Transactions with MySQLPPTim Murison11 Apr
RE: Transactions with MySQLPPSteve Roberts11 Apr
  • RE: Transactions with MySQLPPTim Murison11 Apr