Comments (4)
I barely can understand you, sorry. If you want you could write in Russian.
This driver is fully synchronous - it always waits for data from server before returning. As for ExecuteReader - it waits for execution result and first result set (Block in CH's terminology).
from clickhouse-net.
Простите за мой плохой английский)
Проблема как раз в том, что мое приложение на c#, которые использует эту библиотеку, не ждёт завершения запроса, если он достаточно большой(уточняю это, потом что на небольших запросах все работает, естественно)
Чтобы было проще понять... Я использую ExecuteReader команды, в которой находится INSERT table1 SELECT * FROM table2 - это примерная маска команды, select'ы на самом деле сложнее. Так вот, эта команда выполняется примерно 30 секунд, но так как ExecuteReader не ждёт завершения этой команды, как я утверждаю (а также видно в отладке), на следующей команде(цепляет результат предыдущей) вылетает ошибка.
from clickhouse-net.
Соединения нельзя использовать в разных потоках (в том числе в TPL тасках), это, естественно, приводит к ошибкам.
В принципе, накладные расходы на открытие нового соединиения не велики, так что для каждого запроса можно открывать новое соединение (или использовать connection pool/object pool).
Не очень понятно как и в каком контексте вы ждёте исполнения ExecuteReader, лучше было бы прислать кусок кода, чтобы было понятнее.
И, кстати, всегда и обязательно надо считывать все result-set'ы возвращённые запросом при помощи do{...}while(reader.NextResult())
, иначе непрочтённые блоки будут читаться в ответ на следующий запрос, что, опять же, приведёт к ошибке.
from clickhouse-net.
Спасибо, ваши комментарии отчасти помогли, я действительно подключался к базе с одного потока, а выполнял запросы в другом. Исправил, пришлось ещё поколдовать с таймаутами, потому что запрос все равно не успевал выполниться за какой-то дефолтный таймаут.
from clickhouse-net.
Related Issues (20)
- Any Way To optimize the ClickHouseCommand memory Use HOT 1
- how to set timezone in current connect HOT 3
- Driver hangs when inserting into ReplicatedMergeTree tables HOT 6
- Connection string for cluster db
- Inserting multiple rows doesn't work returns an timeout error HOT 4
- Please add a English and Russian headings in documentation / readme.md HOT 1
- Replace sql parameter error when execute sql HOT 1
- DataTable.Load(DbDataReader) has a wrong hadppend Can't use it in this way? HOT 3
- Пул подключений к БД HOT 1
- System.NotSupportedException:“Unknown column type Decimal(9, 4)” HOT 3
- find a bug ,when process nullable(DateTime) fields
- ClickHouseConnection how to use it properly HOT 1
- how to get correct value from datetime64 ? HOT 1
- DialogueLock of ClickhouseConnection is not released when read command fails and the reader is not created (the method dispose of the reader do the release when it's at least created) HOT 1
- Json Column types are not supported
- Special Character and connect string requirements HOT 1
- Type LowCardinality(Nullable(String)) not supported in v2.0.5 HOT 1
- Best way to measure write performance of batch insertion
- No rows returned in select statement, though data is present in the table HOT 1
- INSERT ... SETTINGS syntax does not work with bulk insertion
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clickhouse-net.