Title: RE: [libpqxx-general] transaction

> I there, is it possible to send a undefine number of queries (SELECTS)
> with
> transactions, and if one of then doesn't return anything do rollback and
> do
> not commit? if not, is there another tool that does that.

Using a transactor would be a safe bet.

Hannes Wagener.




-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Jeroen T. Vermeulen

Sent: 06 January 2006 06:00
To: Luis Silva
Cc: [email protected]
Subject: Re: [libpqxx-general] transaction

On Thu, January 5, 2006 23:39, Luis Silva wrote:
> I there, is it possible to send a undefine number of queries (SELECTS)
> with
> transactions, and if one of then doesn't return anything do rollback and
> do
> not commit? if not, is there another tool that does that.

Seems pretty trivial.  What exactly is it that's giving you trouble?

What you're asking for seems to be something like:

bool do_queries(pqxx::connection_base &C)
{
  work W;
  result r;

  r = W.exec(query1);
  if (r.empty()) return false;
  process_result_of_query1(r);

  r = W.exec(query2);
  if (r.empty()) return false;
  process_result_of_query2(r);

  // ...

  W.commit();
  return true;
}



> I need to get the result of the COMMIT. thanks in advance

What do you mean by the result of the COMMIT?  A commit either succeeds or
fails.  If it fails, an exception is thrown.  There is no result in the
usual sense.


Jeroen


_______________________________________________
Libpqxx-general mailing list
[email protected]
http://gborg.postgresql.org/mailman/listinfo/libpqxx-general

__________________________________________________________________________________________________________________________________
Standard Bank Disclaimer and Confidentiality Note

This e-mail, its attachments and any rights attaching hereto are, unless the context clearly indicates otherwise, the property of Standard Bank Group Limited and/or its subsidiaries ("the Group"). It is confidential, private and intended for the addressee only.

Should you not be the addressee and receive this e-mail by mistake, kindly notify the sender, and delete this e-mail, immediately and do not disclose or use same in any manner whatsoever. Views and opinions expressed in this e-mail are those of the sender unless clearly stated as those of the Group. The Group accepts no liability whatsoever for any loss or damages whatsoever and howsoever incurred, or suffered, resulting, or arising, from the use of this email or its attachments.

The Group does not warrant the integrity of this e-mail nor that it is free of errors, viruses, interception or interference. Licensed divisions of the Standard Bank Group are authorised financial services providers in terms of the Financial Advisory and Intermediary Services Act, No 37 of 2002 (FAIS).

For information about the Standard Bank Group Limited visit our website http://www.standardbank.co.za

__________________________________________________________________________________________________________________________________
_______________________________________________
Libpqxx-general mailing list
[email protected]
http://gborg.postgresql.org/mailman/listinfo/libpqxx-general

Reply via email to