Click or drag to resize

SessionNoServerShared Class

Same as SessionNoServer but SessionNoServerShared is thread safe so it can be shared between threads.
Inheritance Hierarchy

Namespace:  VelocityDb.Session
Assembly:  VelocityDb (in VelocityDb.dll) Version: 11.1.0.0 (11.1)
Syntax
public class SessionNoServerShared : SessionNoServer, 
	IDisposable

The SessionNoServerShared type exposes the following members.

Constructors
  NameDescription
Public methodSessionNoServerShared
Creates a new session. For a thread safe version of this class, use SessionNoServerShared
Top
Properties
  NameDescription
Public propertyAddToIndexInSeperateThread
Allow adding objects to indices to be done in a worker thread instead of in main thread.
(Overrides SessionBaseAddToIndexInSeperateThread.)
Public propertyDatabases
Gets a list of the currently opened databases
(Overrides SessionBaseDatabases.)
Public propertyWriteToDiskInSeperateDatabaseThreads
Allow object serialization and page writes to happen in worker threads, one per database, instead of in main session thread. AddToIndexInSeperateThread must also be enabled for this to work.
(Overrides SessionBaseWriteToDiskInSeperateDatabaseThreads.)
Top
Methods
  NameDescription
Public methodAbort
Transaction control, abort the current transaction
(Overrides SessionBaseAbort.)
Public methodBeginRead
Transaction control, begin a read only transaction
(Overrides SessionBaseBeginRead(Boolean).)
Public methodBeginUpdate
Transaction control, begin an update transaction.
(Overrides SessionBaseBeginUpdate(Boolean).)
Public methodCheckpoint (Overrides SessionBaseCheckpoint.)
Public methodClearCache
Clears page cache and closes databases. Avoid using this one for now.
(Overrides SessionBaseClearCache.)
Public methodClearCashedPages
Clear cache of cached pages
(Overrides SessionBaseClearCashedPages.)
Public methodClearPageCache
Clears cached pages from cache including page weak references.
(Overrides SessionBaseClearPageCache.)
Public methodCompact
Reduce size of databases, if possible, by first attempting to relocate pages to free areas towards the beginning of each Database file and then by truncating files where unused space begins. Run Compact() outside the scope of any transaction.
(Overrides SessionBaseCompact.)
Public methodCompact(Database)
Reduce size of database, if possible, by truncating file where unused space begins
(Overrides SessionBaseCompact(Database).)
Public methodCopyAllDatabasesTo
Copies all databases to a selected directory on the local host.
(Overrides SessionBaseCopyAllDatabasesTo(String, Boolean).)
Public methodCrossTransactionCache
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.
(Overrides SessionBaseCrossTransactionCache(Database, Boolean).)
Public methodDeleteLocation
Deletes a DatabaseLocation, location must first mot have any Databases in it
(Overrides SessionBaseDeleteLocation(DatabaseLocation, Boolean).)
Public methodFileOpen
Opens a Databasefile for read/update. Internal use only.
(Overrides SessionBaseFileOpen(Database, FileAccess, String, FileMode, Boolean, Int32, Boolean).)
Public methodFlushPageOf
By calling this you force a persisted (has an Id) object to be written to disk (if updated) and indices (if any) to be updated. Other objects on the same page page will also be written.
(Overrides SessionBaseFlushPageOf(OptimizedPersistable).)
Public methodFlushUpdates
Write all updated data. This may free up some memory.
(Overrides SessionBaseFlushUpdates.)
Public methodForceDatabaseCacheValidation
Cached data is set to be validated whenever a new transaction is started. This function is provided as a way to force cache validation within a transaction without requiring a commit followed by a new transaction.
(Overrides SessionBaseForceDatabaseCacheValidation.)
Public methodGlobalObjWrapperGet
Lookup wrapper object for a non IOptimizedPersistable object
(Overrides SessionBaseGlobalObjWrapperGet(Object, IOptimizedPersistable).)
Public methodNewDatabase
Create a new Database with a given database number
(Overrides SessionBaseNewDatabase(UInt32, UInt32, String, Boolean).)
Public methodNewLocation
Creates a new DatabaseLocation or updates existing ones
(Overrides SessionBaseNewLocation(DatabaseLocation).)
Public methodOpen(UInt64, Boolean, Boolean, Int32)
Opens a persistent object
(Overrides SessionBase.Open(UInt64, Boolean, Boolean, Int32).)
Public methodOpen(UInt32, UInt16, UInt16, Boolean, Int32)
Opens a persistent object
(Overrides SessionBase.Open(UInt32, UInt16, UInt16, Boolean, Int32).)
Public methodOpen(Database, UInt64, Boolean, ListIOptimizedPersistable, Boolean, Int32, Int32)
For internal usage only, used in generated code
(Overrides SessionBase.Open(Database, UInt64, Boolean, ListIOptimizedPersistable, Boolean, Int32, Int32).)
Public methodOpen(Database, UInt64, Boolean, ListIOptimizedPersistable, Boolean, Int32, Int32, Boolean)
For internal use only in generated code
(Overrides SessionBase.Open(Database, UInt64, Boolean, ListIOptimizedPersistable, Boolean, Int32, Int32, Boolean).)
Public methodOpenAllDatabases
Open all databases
(Overrides SessionBaseOpenAllDatabases(Boolean).)
Public methodOpenDatabase
Opens a Database
(Overrides SessionBaseOpenDatabase(UInt32, Boolean, Boolean).)
Public methodOpenLocationDatabases
Opens all the databases in a given location
(Overrides SessionBaseOpenLocationDatabases(DatabaseLocation, Boolean).)
Public methodOpenSchema
Get the session active schema
(Overrides SessionBaseOpenSchema(Boolean).)
Public methodPersist(IOptimizedPersistable, NullableUInt16)
This is the recommended way of persisting objects, it is simple and efficient. Each type is stored in its own database unless object class overrides PlacementDatabaseNumber and returns something other than DefaultPlacementDatabaseNumber.
(Overrides SessionBasePersist(IOptimizedPersistable, NullableUInt16).)
Public methodPersist(Placement, IOptimizedPersistable, Schema, UInt16, Boolean, QueueIOptimizedPersistable)
Persists an object
(Overrides SessionBasePersist(Placement, IOptimizedPersistable, Schema, UInt16, Boolean, QueueIOptimizedPersistable).)
Public methodPossiblyFlushUpdatedPages
Call this function if you may have updated many pages to possibly free up memory if too much memory is in use.
(Overrides SessionBasePossiblyFlushUpdatedPages(UInt32).)
Public methodRestoreFrom
Restores Databases and pages from a backup DatabaseLocation. Existing data will be merged with the restored data unless existing Databases to restore are deleted before the restore.
(Overrides SessionBaseRestoreFrom(DatabaseLocation, DateTime).)
Public methodSubscribeToChanges
Subscribe to committed database changes of instances of a type when an an optional property evaluates to true.
(Overrides SessionBaseSubscribeToChanges(Type, String).)
Public methodUnpersist
Use this when you want to delete objects that are not assignable as IOptimizedPersistable
(Overrides SessionBaseUnpersist(Object).)
Public methodUpdateDatabase
Request an update lock on a database
(Overrides SessionNoServerUpdateDatabase(Database).)
Public methodUpdateObject(Object)
Tag an object as updated so that it will be updated persistently
(Overrides SessionBaseUpdateObject(Object).)
Public methodUpdateObject(IOptimizedPersistable, Boolean, Boolean)
Updates an object
(Overrides SessionBaseUpdateObject(IOptimizedPersistable, Boolean, Boolean).)
Public methodVerify
Verifies that databases are valid by reading and following references. An exception is thrown if an issue is found.
(Overrides SessionBaseVerify.)
Top
Extension Methods
  NameDescription
Public Extension MethodExportToCSV
Export all persistent objects to .csv files, one file for each Type and version of Type. This is preview release, format may change. ImportFromCSV can be used to recreate your data. Note that Microsoft Excel can't handle many of these CSV files due to a field value limitation (at about 33000 chars) Notepad++ is one application that can read these files. Some fields like array data are encoded http://msdn.microsoft.com/en-us/library/dhx0d524(v=vs.110).aspx
(Defined by ImportExportCsv.)
Public Extension MethodExportToJsonT(UInt64)Overloaded. (Defined by JsonImportExport.)
Public Extension MethodExportToJsonT(Oid)Overloaded. (Defined by JsonImportExport.)
Public Extension MethodExportToJsonT(Boolean, Boolean)Overloaded. (Defined by JsonImportExport.)
Public Extension MethodImportFromCSV
Restores database files, pages and objects from a .csv file data created with ExportToCSV
(Defined by ImportExportCsv.)
Public Extension MethodImportJsonT (Defined by JsonImportExport.)
Public Extension MethodMicrosoftSync (Defined by Sync.)
Public Extension MethodSyncWith(SessionBase)Overloaded. (Defined by Sync.)
Public Extension MethodSyncWith(SessionBase, FuncSessionBase, UInt64, Change, Boolean)Overloaded. (Defined by Sync.)
Top
See Also