File tree 1 file changed +13
-13
lines changed
1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -24,25 +24,25 @@ dut_pqxx::dut_pqxx(std::string conninfo)
24
24
25
25
void dut_pqxx::test (const std::string &stmt)
26
26
{
27
- if (reset_gucs) {
27
+ try {
28
28
29
- if (!c.is_open ())
30
- c.activate ();
29
+ if (reset_gucs) {
31
30
32
- pqxx::work w (c);
31
+ if (!c.is_open ())
32
+ c.activate ();
33
33
34
- w.exec (" set statement_timeout to '1s';"
35
- " set client_min_messages to 'ERROR';"
36
- " set application_name to '" PACKAGE " ::dut';" );
37
- w.commit ();
38
- reset_gucs = false ;
39
- }
34
+ pqxx::work w (c);
40
35
41
- pqxx::work w (c);
42
- try {
36
+ w.exec (" set statement_timeout to '1s';"
37
+ " set client_min_messages to 'ERROR';"
38
+ " set application_name to '" PACKAGE " ::dut';" );
39
+ w.commit ();
40
+ reset_gucs = false ;
41
+ }
42
+
43
+ pqxx::work w (c);
43
44
w.exec (stmt.c_str ());
44
45
} catch (const pqxx::failure &e) {
45
- w.abort ();
46
46
if ((dynamic_cast <const pqxx::broken_connection *>(&e))) {
47
47
/* re-throw to outer loop to recover session. */
48
48
reset_gucs = true ;
You can’t perform that action at this time.
0 commit comments