Click or drag to resize

SessionBaseCrossTransactionCache Method

By default databases are only referenced by a WeakReference across transaction boundaries. This means that such Database may or may not be available as a cached database depending on garbage collection activity and if such database also has a strong reference. This function lets you add a strong reference to a Database so the cached Database may be used if version wasn't changed by a different thread since prior transaction. The strong reference is removed once the Database is reopened.

Namespace:  VelocityDb.Session
Assembly:  VelocityDb (in VelocityDb.dll) Version: 11.1.0.0 (11.1)
Syntax
public virtual void CrossTransactionCache(
	Database db,
	bool enable = true
)

Parameters

db
Type: VelocityDbDatabase
The Database to cache
enable (Optional)
Type: SystemBoolean
Add or remove strong reference. If true, add a strong reference
See Also