SessionBase Methods |
The SessionBase type exposes the following members.
Name | Description | |
---|---|---|
Abort |
Transaction control, abort the current transaction
| |
AllObjectsT |
Gets an object used for enumerating all objects in all Databases
| |
AnyPageWritten |
Find out if any pages have been written for a given database in this update transaction
| |
BeginRead |
Transaction control, begin a read only transaction
| |
BeginUpdate |
Transaction control, begin an update transaction.
| |
BeginUpdate(Boolean) |
Transaction control, begin an update transaction.
| |
Checkpoint |
Same as Commit(Boolean, Boolean) followed by BeginUpdate | |
ClearCache |
Clears page cache and closes databases. Avoid using this one for now.
| |
ClearCachedObjects |
Clears the cache of cached objects.
| |
ClearCachedObjects(Database) |
Clears the cache of cached objects within a Database.
| |
ClearCashedPages |
Clear cache of cached pages
| |
ClearPageCache |
Clears cached pages from cache including page weak references.
| |
CloseDatabase |
Closes a Database
| |
Commit |
Transaction control, commit the current transaction
| |
Compact |
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.
| |
Compact(Database) |
Reduce size of database, if possible, by truncating file where unused space begins
| |
CompareTo |
The defualt compare of two SessionBase is by system (bootup) host name and directory
| |
ContainsDatabase |
Check if database file exist in a given DatabaseLocation | |
CopyAllDatabasesTo |
Copies all databases to a selected directory on the local host.
| |
CreateDirectory |
Creates a directory
| |
CrossTransactionCache |
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.
| |
CrossTransactionCacheAllDatabases |
By default databases are referenced by strong references instead of 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 all Databases so the cached Database may be used if version wasn't changed by a different thread since prior transaction.
A strong reference is removed for any database that get invalidated due to a transaction abort or if another transaction commits a change to it.
Check current session state with StrongReferenceDatabaseCaching | |
DatabaseNumberOf |
Get the database number associated with a specific type. Your application can store any type of object in any database but if the application exclusively
use Persist(IOptimizedPersistable, NullableUInt16) or Persist(Object) then this is the database Id that will be used given a type.
| |
DatabaseStillExist |
Check if Database still exist
| |
DefaultDatabaseLocation |
Gets the default (startup) DatabaseLocation
| |
DeleteDatabase |
Delete a database, actual database file delete happens after a successful transaction commit.
| |
DeleteFile |
Delete a file. For internal use.
| |
DeleteLocation |
Deletes a DatabaseLocation, location must first mot have any Databases in it
| |
DeleteObject |
A way to delete an object without requiring that the object be opened first
| |
DeletePage |
Deletes a page from a database. (part of database Sync beta version - not yet fully designed and tested)
Used by SyncWith when syncing databases with another replica of the current databases
| |
DeployGenerateReaderWriter |
Part of code generator, not yet ready for public release
| |
DeployInternalTypes |
For internal use only
| |
Dispose |
Closes this session
| |
FileOpen(Database, FileAccess, String, FileMode, Boolean, Int32, Boolean) |
Opens a Databasefile for read/update. Internal use only.
| |
FileOpen(FileInfo, FileAccess, String, FileShare, FileMode, Int32, Boolean, Boolean) |
For internal use.
| |
FirstFreePage |
Gets the page number of the first unallocated page in the specified Database
| |
FlushPageOf |
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.
| |
FlushUpdates |
Write all updated data. This may free up some memory.
| |
FlushUpdates(Database) |
Write any updated/new pages for a specific Database
| |
FlushUpdatesServers |
Make servers Write all updated data. This may free up some memory on the servers. Only effects sessions using VelocityDbServer(s)
| |
ForceDatabaseCacheValidation |
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.
| |
GetEnumerator |
Enumerates all open databases for this session
| |
GetVersion |
Gets the version of Database 0
| |
GlobalObjWrapperGet |
Lookup wrapper object for a non IOptimizedPersistable object
| |
HighestInUseDatabaseNumber |
Figure out what the highest in use database number is and return it.
| |
HighestInUseLocalDatabaseNumber |
Figure out what the highest in use database number is on the local host and return it.
| |
IdOf |
Finds the object id of a persistent object
| |
IndexT |
Gets an index of all objects of a certain type
| |
IndexT(String) |
Gets an index of all objects of a certain type
| |
IndexT(Database) |
Gets an index of all objects of a certain type within a given database (attribute OnePerDatabase must be used).
If you have updated objects persisted in a prior transaction that you want part of an index. Call FlushUpdates
or call Write/> to add such an object to index before querying using an index./>
| |
IndexT(String, Database) |
Gets an index of all objects of a certain type within a given database (attribute OnePerDatabase must be used)
| |
InUseNumberOfPages |
Gets the number of pages currently in use by a Database
| |
IsSameHost |
Determine if two host names represent the same tcp/ip host
| |
IsWorkerThread |
Tell if code is executed by index or page write worker thread
| |
LoadFields |
Loads all field values of an object if they are not already loaded.
| |
LocateDb |
Lookup the DatabaseLocation of a Database with a specified database number.
| |
NewDatabase |
Create a new Database with a given database number
| |
NewLocation |
Creates a new DatabaseLocation or updates existing ones
| |
ObjectsT |
Enumerates all the objects of a given type
| |
OfType |
Gets an object used for enumerating all objects in all Databases
| |
OidOf |
Finds the object id of a persistent object
| |
OidShortOf |
Finds the object id of a persistent object
| |
OpenAllDatabases |
Open all databases
| |
OpenDatabase |
Opens a Database
| |
OpenDatabaseLocations |
Open the DatabaseLocations object and store it in the session.
| |
OpenLocationDatabases |
Opens all the databases in a given location
| |
OpenPage |
Opens a page for read, used by DatabaseManager for page browsing
| |
OpenSchema |
Get the session active schema
| |
ParseCsvRow |
Parses a row in a csv file and returns an iterator of column string values
| |
Persist(Object) |
This is the recommended way of persisting objects, it is simple and efficient. Each type is stored in its own database.
| |
Persist(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.
| |
Persist(Placement, IOptimizedPersistable) |
Persist an object that is an OptimizedPersistable or a subclass
| |
Persist(Object, IOptimizedPersistable, Boolean) |
Persist an object that may or may not be a subclass of OptimizedPersistable
| |
Persist(Object, Placement, Boolean) |
Persist an object that may or may not be a subclass of OptimizedPersistable
| |
Persist(Placement, IOptimizedPersistable, Schema, UInt16, Boolean, QueueIOptimizedPersistable) |
Persists an object
| |
PossiblyFlushUpdatedPages |
Call this function if you may have updated many pages to possibly free up memory if too much memory is in use.
| |
RegisterClass |
Register a class in the persistent schema.
It is a good idea to do this explicitly instead of having it happen the first time an object of an unregistered class is made persistent
| |
RelocateDatabaseLocationFor |
After moving/copying directory containing your Database with id dbId call this before starting a transaction to update host and directory of the associated DatabaseLocation.
This function does not move the database files, it only updates the DatabaseLocation.
| |
RelocateDefaultDatabaseLocation |
After moving/copying directory containing your Databases 0.odb, 1.odb ... call this before starting a transaction to update host and directory of the default DatabaseLocation.
This function does not move the database files, it only updates the DatabaseLocation.
| |
ReplacePage |
Only to be used in VelocityDbExtensions while syncing databases
| |
ReplacePersistedType(String, Type) |
Updates the Type assocuiated with a VelocityDbType. This can be used when you want to rename a class or move a class to a different namespace.
You will need to have the prior Type loaded as it it is defined in the current Schema for this to work. Once the update has been done, you should no longer need
to keep the old Type loaded. Be sure to backup all your data before doing this.
| |
ReplacePersistedType(Type, Type) |
Updates the Type assocuiated with a VelocityDbType. This can be used when you want to rename a class or move a class to a different namespace.
You will need to have the prior Type loaded as it it is defined in the current Schema for this to work. Once the update has been done, you should no longer need
to keep the old Type loaded. Be sure to backup all your data before doing this.
| |
RestoreFrom(DatabaseLocation, DateTime) |
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.
| |
RestoreFrom(String, String, UInt32, DateTime) |
Restores a DatabaseLocation | |
SetMinMaxStringIntern |
A persistent string read into memory from a Database is interned using Intern(String) to speed up comparisons and conserve memory (when the same string occurs in many places)
| |
SetTraceAllDbActivity |
Enable some Trace output about persistent events related to all databases and pages. Add a Trace listener to get to Console window: Trace.Listeners.Add(new ConsoleTraceListener());
| |
SetTraceDbActivity |
Enable some Trace output about persistent events related to a Database. Add a Trace listener to get to Console window: Trace.Listeners.Add(new ConsoleTraceListener());
| |
StringToType |
Gets a Type given a string representation of a type
| |
SubscribeToChanges |
Subscribe to committed database changes of instances of a type when an an optional property evaluates to true.
| |
TryDatabase |
Gets the current database to try
| |
Unpersist |
Use this when you want to delete objects that are not assignable as IOptimizedPersistable | |
UnsubscribeToChanges |
Unsubscribe to committed database changes of instances of a type when an optional property evaluates to true.
| |
UpdateClass |
Let VelocityDB know that changes have been made to a class so that the schema manager will create a new TypeVersion and use the new version for all new objects of the specified Type.
| |
UpdateDatabase |
Request an update lock on a database
| |
UpdateObject(Object) |
Tag an object as updated so that it will be updated persistently
| |
UpdateObject(IOptimizedPersistable) |
Tag an object as updated so that it will be updated persistently
| |
UpdateObject(Object, Action) |
Provides a way to update an object in a multi thraeded scenario where we must make sure that object page isn't flushed until updates to object are done.
| |
UpdateObject(IOptimizedPersistable, Action) |
Provides a way to update an object in a multi thraeded scenario where we must make sure that object page isn't flushed until updates to object are done.
| |
UpdateObject(IOptimizedPersistable, Boolean, Boolean) |
Updates an object
| |
UpdatePage |
Update a Page. Used by VelocityDBExtensions project
| |
Verify |
Verifies that databases are valid by reading and following references. An exception is thrown if an issue is found.
| |
WaitForIndexUpdates |
Internal Use and in VelocityDBExtensions
| |
WritePageBytes |
Name | Description | |
---|---|---|
ExportToCSV |
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.) | |
ExportToJsonT(UInt64) | Overloaded. (Defined by JsonImportExport.) | |
ExportToJsonT(Oid) | Overloaded. (Defined by JsonImportExport.) | |
ExportToJsonT(Boolean, Boolean) | Overloaded. (Defined by JsonImportExport.) | |
ImportFromCSV |
Restores database files, pages and objects from a .csv file data created with ExportToCSV
(Defined by ImportExportCsv.) | |
ImportJsonT | (Defined by JsonImportExport.) | |
MicrosoftSync | (Defined by Sync.) | |
SyncWith(SessionBase) | Overloaded. (Defined by Sync.) | |
SyncWith(SessionBase, FuncSessionBase, UInt64, Change, Boolean) | Overloaded. (Defined by Sync.) |