Note: Starcounter 3.0.0 is currently in preview stage. This API might be changed in the future releases without backwards compatibility.
Absolute or relative database directory path.
Specifies database creation strategy.
Specifies database startup strategy.
Specifies database shut down strategy.
2 - 24
Specifies number of database contexts allocated for this connection.
Open - Opens the database if it exist.
CreateIfNotExists - Opens the database if it exist, and creates one if it doesn't.
RequireStarted - Expects database processes to be running, and won't attempt starting them.
StartIfNotRunning - Connects if database processes are already running, and start them first if they are not.
StartExclusive - Expects no database processes to be running, and start them if they are not. Refuse to connect if database processes are already running.
IfWeStarted - Stops database processes if they where started by the current application.
Never - Leaves database processes running, even after the application shuts down and even if the application started them.
Never option is not effective when the application process is forcibly killed with task manager or
Ctrl + C. In this case operating system will kill corresponding Starcounter processes as well.
Starcounter has maximum of
31 database contexts available for allocation between multiple processes. By default, Starcounter application tries to allocate double as many contexts as CPU cores available, but minimum
2 and maximum
The ideal configuration is to have a database context per CPU core. Having more database contexts than CPU cores might increase performance in certain concurrent database access workloads. Having less database contexts than CPU cores might decrease performance of concurrent database access during high concurrent load.
ContextCount option to manually adjust database contexts allocation.