Marian Naghen wrote:
> Well, you are right...I forgot that.
>  
> The problem is when executing the queries starting with the second, no 
> exception are throwed in case of failure.
> Let me show you the code. The line marked try to exec a query that shoud 
> not be accepted by the database.
> The query is rejected, of course, but no exception is catched.

Hmmm, transactors will usually retry the operation when it fails 
(depending on the retry count given to perform()), so you have to be 
sure that on a second call to operator(), the code fails in exactly the 
same way. My suspicion is that what happens is this:

1. connection_base::perform() calls your operator() the first time, it 
fails.
2. connection_base::perform() rolls back the transaction.
3. connection_base::perform() retries, and calls your operator() the 
second time. Now it doesn't fail because some values in your transactor 
have changed.

Could you check if this is what happens?

Cheers,
Bart

_______________________________________________
Libpqxx-general mailing list
Libpqxx-general@gborg.postgresql.org
http://gborg.postgresql.org/mailman/listinfo/libpqxx-general

Reply via email to