mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 18:12:02 +00:00
set use_connection_pooling from settings everywhere
This commit is contained in:
parent
70a3ffa0e6
commit
0d2e4fcc15
@ -64,7 +64,7 @@ public:
|
||||
ContextPtr context_,
|
||||
Poco::Timespan http_timeout_,
|
||||
const std::string & connection_string_,
|
||||
bool use_connection_pooling_=true)
|
||||
bool use_connection_pooling_)
|
||||
: IXDBCBridgeHelper(context_->getGlobalContext())
|
||||
, log(&Poco::Logger::get(BridgeHelperMixin::getName() + "BridgeHelper"))
|
||||
, connection_string(connection_string_)
|
||||
|
@ -173,7 +173,8 @@ namespace
|
||||
|
||||
BridgeHelperPtr bridge_helper = std::make_shared<XDBCBridgeHelper<BridgeHelperMixin>>(args.getContext(),
|
||||
args.getContext()->getSettingsRef().http_receive_timeout.value,
|
||||
checkAndGetLiteralArgument<String>(engine_args[0], "connection_string"));
|
||||
checkAndGetLiteralArgument<String>(engine_args[0], "connection_string"),
|
||||
args.getContext()->getSettingsRef().odbc_bridge_use_connection_pooling.value);
|
||||
return std::make_shared<StorageXDBC>(
|
||||
args.table_id,
|
||||
checkAndGetLiteralArgument<String>(engine_args[1], "database_name"),
|
||||
|
@ -56,7 +56,7 @@ void ITableFunctionXDBC::startBridgeIfNot(ContextPtr context) const
|
||||
{
|
||||
if (!helper)
|
||||
{
|
||||
helper = createBridgeHelper(context, context->getSettingsRef().http_receive_timeout.value, connection_string);
|
||||
helper = createBridgeHelper(context, context->getSettingsRef().http_receive_timeout.value, connection_string, context->getSettingsRef().odbc_bridge_use_connection_pooling.value);
|
||||
helper->startBridgeSync();
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,8 @@ private:
|
||||
/* A factory method to create bridge helper, that will assist in remote interaction */
|
||||
virtual BridgeHelperPtr createBridgeHelper(ContextPtr context,
|
||||
Poco::Timespan http_timeout_,
|
||||
const std::string & connection_string_) const = 0;
|
||||
const std::string & connection_string_,
|
||||
bool use_connection_pooling_) const = 0;
|
||||
|
||||
ColumnsDescription getActualTableStructure(ContextPtr context) const override;
|
||||
|
||||
@ -47,9 +48,10 @@ public:
|
||||
private:
|
||||
BridgeHelperPtr createBridgeHelper(ContextPtr context,
|
||||
Poco::Timespan http_timeout_,
|
||||
const std::string & connection_string_) const override
|
||||
const std::string & connection_string_,
|
||||
bool use_connection_pooling_) const override
|
||||
{
|
||||
return std::make_shared<XDBCBridgeHelper<JDBCBridgeMixin>>(context, http_timeout_, connection_string_);
|
||||
return std::make_shared<XDBCBridgeHelper<JDBCBridgeMixin>>(context, http_timeout_, connection_string_, use_connection_pooling_);
|
||||
}
|
||||
|
||||
const char * getStorageTypeName() const override { return "JDBC"; }
|
||||
@ -67,9 +69,10 @@ public:
|
||||
private:
|
||||
BridgeHelperPtr createBridgeHelper(ContextPtr context,
|
||||
Poco::Timespan http_timeout_,
|
||||
const std::string & connection_string_) const override
|
||||
const std::string & connection_string_,
|
||||
bool use_connection_pooling_) const override
|
||||
{
|
||||
return std::make_shared<XDBCBridgeHelper<ODBCBridgeMixin>>(context, http_timeout_, connection_string_);
|
||||
return std::make_shared<XDBCBridgeHelper<ODBCBridgeMixin>>(context, http_timeout_, connection_string_, use_connection_pooling_);
|
||||
}
|
||||
|
||||
const char * getStorageTypeName() const override { return "ODBC"; }
|
||||
|
Loading…
Reference in New Issue
Block a user