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
Currently, the way to specify default timeout and retry limit settings is to set them on a IFdbDatabase instance, and they will be automatically used by all transactions created from this database instance.
When using the Fdb.OpenNamedPartitionAsync(...) method to create a database instance, you have to wait for the method to complete to get back the db instance and configure it. The problem is that this method need to start a few transactions to read the root subspace prefix from the Directory Layer, which means that it will use the defaults timeout settings (infinite). If the database is not started (or unavailable), then OpenNamedPartitionAsync(..) will not return until either the db goes online, or the CancellationToken passed to it fires (or never if it was CancellationToken.None).
We need a way to pass the various settings to the OpenAsync(...) and OpenNamedPartitionAsync(...) so that they can use them.
Something like
varsettings=newFdbConnectionSettings{ClusterFile=@".....",DbName="DB",DefaultTimeout=60*1000,DefaultRetryLimit=10,// ... more settings to come in future versions?}vardb=awaitFdb.OpenNamedPartitionAsync(settings,someGlobalCancellationToken);// db.DefaultTimeout => 60000// db.DefaultRetryLimit => 10
The text was updated successfully, but these errors were encountered:
…sync
- Add FdbConnectionOptions class that contains all main options and knobs for the client (clusterfile, timeouts, etc...)
- Fdb.OpenAsync(FdbConnectionOptions) can open any database, including named partitions
- Fdb.Directory.OpenNamedPartitionAsync are deprecated since OpenAsync can do the job
- Allows settings default timeout and retry limits before accessing the Directory Layer (cf Issue #61)
I changed the code to be able to specify default timeout/retry limits, AND open a named partition in a single call to Fdb.OpenAsync(...).
Sample code that opens the named partition ("Foo", "Bar") with a default timeout of 30 sec.
varoptions=newFdbConnectionOptions(){ClusterFiler="....",// null for default pathDefaultTimeout=TimeSpan.FromSeconds(30),// 0 for infinite timeout (default)PartitionPath=new[]{"Foo","Bar"},// or no partition if null// other settings}vardb=awaitFdb.OpenAsync(options,ct);// opens the database, and switch to the named partitions automatically// will abort after 30sec if db is not available
This means that Fdb.Directory.OpenNamedPartitions(...) is now obsolete (Fdb.OpenAsync(FdbConnectionOptions, ...) can do the same job).
Currently, the way to specify default timeout and retry limit settings is to set them on a
IFdbDatabase
instance, and they will be automatically used by all transactions created from this database instance.When using the
Fdb.OpenNamedPartitionAsync(...)
method to create a database instance, you have to wait for the method to complete to get back the db instance and configure it. The problem is that this method need to start a few transactions to read the root subspace prefix from the Directory Layer, which means that it will use the defaults timeout settings (infinite). If the database is not started (or unavailable), thenOpenNamedPartitionAsync(..)
will not return until either the db goes online, or theCancellationToken
passed to it fires (or never if it wasCancellationToken.None
).We need a way to pass the various settings to the
OpenAsync(...)
andOpenNamedPartitionAsync(...)
so that they can use them.Something like
The text was updated successfully, but these errors were encountered: