You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,3 +76,10 @@ client.Select("SELECT id, name FROM test.numbers", [] (const Block& block)
76
76
client.Execute("DROP TABLE test.numbers");
77
77
```
78
78
Please note that `Client` instance is NOT thread-safe. I.e. you must create a separate `Client` for each thread or utilize some synchronization techniques.
79
+
80
+
## Retries
81
+
If you wish to implement some retry logic atop of `clickhouse::Client` there are few simple rules to make you life easier:
82
+
- If previous attempt threw an exception, then make sure to call `clickhouse::Client::ResetConnection()` before the next try.
83
+
- For `clickhouse::Client::Insert()` you can reuse a block from previous try, no need to rebuild it from scratch.
84
+
85
+
See https://github.com/ClickHouse/clickhouse-cpp/issues/184 for details.
0 commit comments