tursodatabase/turso · error · NotSupportedException

Pooling is not supported for embedded replica connections ye

Error message

Pooling is not supported for embedded replica connections yet. Set Pooling=False.

What it means

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.

Source

Thrown at bindings/dotnet/src/Turso.Data/TursoConnection.cs:503

            RemoteEncryption = _connectionOptions.GetRemoteEncryption(),
            PushOperationsThreshold = _connectionOptions.PushOperationsThreshold == 0
                ? null
                : _connectionOptions.PushOperationsThreshold,
            PullBytesThreshold = _connectionOptions.PullBytesThreshold == 0
                ? null
                : _connectionOptions.PullBytesThreshold,
            ForceLogicalMvccPull = _connectionOptions.ForceLogicalMvccPull,
            ExperimentalFeatures = string.IsNullOrWhiteSpace(_connectionOptions.SyncExperimentalFeatures)
                ? null
                : _connectionOptions.SyncExperimentalFeatures,
            HttpClient = SyncHttpClientFactory?.Invoke(),
        };
    }

    private void ValidateReplicaOptions()
    {
        if (_connectionOptions.Pooling)
            throw new NotSupportedException("Pooling is not supported for embedded replica connections yet. Set Pooling=False.");
        if (_connectionOptions.SyncInterval != 0)
            throw new NotSupportedException("Automatic sync is not supported for embedded replica connections yet. Set Sync Interval=0 and call SyncAsync explicitly.");
    }

    private void ValidateLocalOnlyOptions()
    {
        if (!string.IsNullOrWhiteSpace(_connectionOptions.AuthToken))
            throw new InvalidOperationException("Auth Token requires a remote Turso URL Data Source.");
        if (!string.IsNullOrWhiteSpace(_connectionOptions.ReplicaPath))
            throw new InvalidOperationException("Replica Path requires a remote Turso URL Data Source.");
        if (_connectionOptions.SyncInterval > 0)
            throw new InvalidOperationException("Sync Interval requires a remote embedded replica connection.");
        if (_connectionOptions.HasAdvancedReplicaOptions)
            throw new InvalidOperationException("Advanced sync options require a remote embedded replica connection.");
        if (_connectionOptions.Tls.HasValue)
            throw new InvalidOperationException("Tls requires a remote Turso URL Data Source.");
    }

View on GitHub (pinned to c1e5928725)

Solutions

  1. Add 'Pooling=False' to the connection string.
  2. If pooling was needed for throughput, open a single long-lived replica connection in your app instead of many short-lived ones.

Example fix

// before
"Data Source=app.db;Replica Path=app.db;Pooling=True"
// after
"Data Source=app.db;Replica Path=app.db;Pooling=False"
Defensive patterns

Strategy: validation

Validate before calling

var builder = new TursoConnectionStringBuilder(cs);
if (builder.Pooling && isReplica)
    builder.Pooling = false; // pooling is unsupported for embedded replicas

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of tursodatabase/turso@c1e5928725 (2026-08-31). Data as JSON: /api/errors/ddddd64bc576a45e. Report an issue: GitHub.