{"record":{"id":"ddddd64bc576a45e","repo":"tursodatabase/turso","slug":"pooling-is-not-supported-for-embedded-replica-conn","errorCode":null,"errorMessage":"Pooling is not supported for embedded replica connections yet. Set Pooling=False.","messagePattern":"Pooling is not supported for embedded replica connections yet\\. Set Pooling=False\\.","errorType":"validation","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"bindings/dotnet/src/Turso.Data/TursoConnection.cs","lineNumber":503,"sourceCode":"            RemoteEncryption = _connectionOptions.GetRemoteEncryption(),\n            PushOperationsThreshold = _connectionOptions.PushOperationsThreshold == 0\n                ? null\n                : _connectionOptions.PushOperationsThreshold,\n            PullBytesThreshold = _connectionOptions.PullBytesThreshold == 0\n                ? null\n                : _connectionOptions.PullBytesThreshold,\n            ForceLogicalMvccPull = _connectionOptions.ForceLogicalMvccPull,\n            ExperimentalFeatures = string.IsNullOrWhiteSpace(_connectionOptions.SyncExperimentalFeatures)\n                ? null\n                : _connectionOptions.SyncExperimentalFeatures,\n            HttpClient = SyncHttpClientFactory?.Invoke(),\n        };\n    }\n\n    private void ValidateReplicaOptions()\n    {\n        if (_connectionOptions.Pooling)\n            throw new NotSupportedException(\"Pooling is not supported for embedded replica connections yet. Set Pooling=False.\");\n        if (_connectionOptions.SyncInterval != 0)\n            throw new NotSupportedException(\"Automatic sync is not supported for embedded replica connections yet. Set Sync Interval=0 and call SyncAsync explicitly.\");\n    }\n\n    private void ValidateLocalOnlyOptions()\n    {\n        if (!string.IsNullOrWhiteSpace(_connectionOptions.AuthToken))\n            throw new InvalidOperationException(\"Auth Token requires a remote Turso URL Data Source.\");\n        if (!string.IsNullOrWhiteSpace(_connectionOptions.ReplicaPath))\n            throw new InvalidOperationException(\"Replica Path requires a remote Turso URL Data Source.\");\n        if (_connectionOptions.SyncInterval > 0)\n            throw new InvalidOperationException(\"Sync Interval requires a remote embedded replica connection.\");\n        if (_connectionOptions.HasAdvancedReplicaOptions)\n            throw new InvalidOperationException(\"Advanced sync options require a remote embedded replica connection.\");\n        if (_connectionOptions.Tls.HasValue)\n            throw new InvalidOperationException(\"Tls requires a remote Turso URL Data Source.\");\n    }\n","sourceCodeStart":485,"sourceCodeEnd":521,"githubUrl":"https://github.com/tursodatabase/turso/blob/c1e59287258d99b309e362a63f48822256e2f65f/bindings/dotnet/src/Turso.Data/TursoConnection.cs#L485-L521","documentation":"The .NET Turso driver does not yet support connection pooling for embedded replica connections. ValidateReplicaOptions() throws NotSupportedException during OpenReplica/OpenReplicaAsync when Pooling is enabled, forcing callers to disable pooling explicitly so pooled handle reuse cannot break replica sync state.","triggerScenarios":"Opening an embedded replica connection whose connection string contains 'Pooling=True' (or omits it when pooling is the default) before any replica operation is performed.","commonSituations":"Reusing an existing application connection-string template with Pooling=True and pointing it at an embedded replica; default connection-string builders that emit Pooling=True.","solutions":["Add 'Pooling=False' to the connection string.","If pooling was needed for throughput, open a single long-lived replica connection in your app instead of many short-lived ones."],"exampleFix":"// before\n\"Data Source=app.db;Replica Path=app.db;Pooling=True\"\n// after\n\"Data Source=app.db;Replica Path=app.db;Pooling=False\"","handlingStrategy":"validation","validationCode":"var builder = new TursoConnectionStringBuilder(cs);\nif (builder.Pooling && isReplica)\n    builder.Pooling = false; // pooling is unsupported for embedded replicas","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set Pooling=False explicitly on replica connection strings.","Reuse a single long-lived replica connection instead of relying on pooling."],"tags":["dotnet","embedded-replica","pooling","connection-string"],"backgroundTag":"pooling-unsupported-for-replica","analyzedSha":"c1e59287258d99b309e362a63f48822256e2f65f","analyzedAt":"2026-08-31T11:17:35.598Z","contentChangedAt":"2026-08-31T11:17:35.598Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}