| 55 | } |
| 56 | |
| 57 | void Connection::updateConnection() |
| 58 | { |
| 59 | if (connection) |
| 60 | connection->close(); |
| 61 | |
| 62 | /// Always throws if there is no connection. |
| 63 | connection = std::make_unique<pqxx::connection>(connection_info.connection_string); |
| 64 | |
| 65 | if (replication) |
| 66 | connection->set_variable("default_transaction_isolation", "'repeatable read'"); |
| 67 | |
| 68 | LOG_DEBUG(getLogger("PostgreSQLConnection"), "New connection to {}", connection_info.host_port); |
| 69 | } |
| 70 | |
| 71 | void Connection::connect() |
| 72 | { |