Opened 5 years ago

Last modified 3 years ago

#269 new defect

pqxx::nontransaction doesn't handle connection problem

Reported by: anonymous Owned by: jtv
Priority: normal Component: connections
Severity: Unusable Keywords:

Description (last modified by jtv)


I wrote simple test:

     pqxx::connection conn("user=... password=... dbname=...");
     while (1) 
               pqxx::nontransaction tr(conn, __FUNCTION__);
               const pqxx::result res = tr.parameterized("select * from document where document_id > $1")(5).exec();
               printf("got %d entries\n", res.size());
          catch (const std::exception& ex)
               printf("Exception: %s\n", ex.what());

App works, prints "got N entries" message while everything is ok. When I restart database I see endless "Exception: Database backend version does not support parameterized statements." error messages.

When I change pqxx::nontransaction to pqxx::read_transaction or pqxx::work app handles connection lost correctly. It goes on to work correctly after database restart.

Why pqxx::nontransaction behaves this way?

Thank you.

Change History (3)

comment:1 Changed 4 years ago by RichardWef

  • version changed from 4.0 to 3.0
Last edited 3 years ago by jtv (previous) (diff)

comment:2 Changed 3 years ago by jtv

  • Description modified (diff)

comment:3 Changed 3 years ago by jtv

  • milestone 3.1 deleted

Milestone 3.1 deleted

Note: See TracTickets for help on using tickets.