Persistate API documentation
DbaSession Class
NamespacesPersistateDbaSession

[This is preliminary documentation and is subject to change.]

This class represents a Session which performs DataBase Access.
Declaration Syntax
C#
public class DbaSession : Session
Members
All MembersMethodsPropertiesFieldsEvents



IconMemberDescription
ActiveDatabaseExceptionHandler
Gets the default DatabaseExceptionHandler for the active session.

Adopt(Persistent, IReference%, Int32)
This method is intended for use only from generated code, and you should not use it in open code.
(Inherited from Persistent.)
Adopted
Occurs when this object is adopted as a contained (not associated) child object of another object.
(Inherited from Persistent.)
AnnotationSeparator
This string is used to separate the text in NominativeText and DiscriminativeText properties
(Inherited from Persistent.)
Associate(Persistent, IReference%, Int32)
This method is intended for use only from generated code, and you should not use it in open code.
(Inherited from Persistent.)
Associated
Occurs when this object is taken as an associated child object of another object.
(Inherited from Persistent.)
AssociatorCount()()()()
Gets the number of associations made to this object.
(Inherited from Persistent.)
Authenticated
Gets a value indicating whether the Principal running this session has been authenticated.
(Inherited from Session.)
Authorised
Gets a value indicating whether the Principal running this Session has been authorised to use the RunningPackage.
(Inherited from Session.)
BaseClassReference(Persistent, Reference)
Here only to allow consistent use of new keyword in generated classes. Always throws an exception.
(Inherited from Persistent.)
CallConcurrent(Work)
Executes a method with no parameters on a ThreadPool thread.
(Inherited from Session.)
CallConcurrent<(Of <<'(T>)>>)(Work<(Of <<'(T>)>>), T)
Executes a method with one parameter on a ThreadPool thread.
(Inherited from Session.)
CallConcurrent<(Of <<'(T, U>)>>)(Work<(Of <<'(T, U>)>>), T, U)
Executes a method with two parameters on a ThreadPool thread.
(Inherited from Session.)
CallPeriodic(Work, Int32, Int32)
Executes a parameterless method at regular intervals on a ThreadPool thread.
(Inherited from Session.)
CallPeriodic<(Of <<'(T>)>>)(Work<(Of <<'(T>)>>), T, Int32, Int32)
Executes a one parameter method at regular intervals on a ThreadPool thread.
(Inherited from Session.)
CallPeriodic<(Of <<'(T, U>)>>)(Work<(Of <<'(T, U>)>>), T, U, Int32, Int32)
Executes a two parameter method at regular intervals on a ThreadPool thread.
(Inherited from Session.)
CallTree(CallTreeData, Int32)
In derived classes, calls a particular delegate for every node in a persistent tree.
(Inherited from Persistent.)
CallTree(CallTreeData)
Starts a recursive descent of the persistent containment tree from this object, calling a delegate for every node in the tree below this object.
(Inherited from Persistent.)
Class
Gets the ObjectClass object associated with this object.
(Inherited from Session.)
ClassFlags
Gets the class flags for the Session class.
(Inherited from Session.)
Clone()()()()
Creates a copy of this object.
(Inherited from Persistent.)
Commit()()()()
Commits to the appopriate Databases all modifications which have been made since the start of the active Execution, or since the last call to Commit or UndoModifications(Boolean).
(Overrides Session.Commit()()()().)
Committed
Occurs whenever an operation execution has committed mutations to persistent storage.
(Inherited from Session.)
ContainingEnvironment
Gets the Environment that this object is contained within.
(Inherited from Persistent.)
CopyFrom(Persistent)
Copies values of fields from another Persistent of the same type.
(Inherited from Persistent.)
CopyTransientFrom(Persistent)
Allows derived classes to copy transient data when CopyFrom is called.
(Inherited from Persistent.)
CurrentEnvironment
Gets the Environment that this Session is currently running in.
(Inherited from Session.)
Database
Gets the Database object for the database in which this object is or is to be stored.
(Inherited from Persistent.)
DeAssociateFrom(Persistent, Int32)
This method is intended for use only from generated code, and you should not use it in open code.
(Inherited from Persistent.)
DefaultDatabaseExceptionHandler
Gets or sets the default database exception handler for the session. By default, this is set to Session.StandardDatabaseExceptionHandler.

Deleted
This event occurs when an object is deleted.
(Inherited from Persistent.)
DeleteVolatile(IReference)
This method is intended for use only from generated code, and you should not use it in open code.
(Inherited from Persistent.)
DePersist(Object)
This method is intended for use only from generated code, and you should not use it in open code.
(Inherited from Persistent.)
DePersistFrom(IPersistateList, Object)
This method is intended for use only from generated code, and you should not use it in open code.
(Inherited from Persistent.)
DeReference(Persistent)
Returns this object.
(Inherited from Persistent.)
DiscriminativeText
Gets a string containing values of discriminative properties.
(Inherited from Session.)
Disowned
Occurs when this object is disowned from being a contained (not associated) child object of another object.
(Inherited from Persistent.)
Dissociated
Occurs when this object is removed from being an associated child object of another object.
(Inherited from Persistent.)
EndedAt
The date and time at which the Session ended.
(Inherited from Session.)
Equals(Persistent)
Determines if this Persistent is equal to another.
(Inherited from Persistent.)
Equals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Executions
The set of Operation Executions executed in the Session.
(Inherited from Session.)
ExitRequested
Gets a value indicating that the Exit operation has been initiated for this Session.
(Inherited from Session.)
FillFromDatabase(Database, IDataReader)
This method is intended for use only from generated code, and you should not use it in open code.
(Inherited from Persistent.)
FillFromMessage(Message)
This method is intended for use only from generated code, and you should not use it in open code.
(Inherited from Persistent.)
Finalize()()()()
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
FindSingleton(ObjectClass)
Gets the singleton object for the running Package in the current Environment with a particular class.
(Inherited from Session.)
GetAssociators()()()()
Gets a collection of all objects which have associations to this object.
(Inherited from Persistent.)
GetChildren<(Of <<'(T>)>>)(IndexedList<(Of <<'(T>)>>), ObjectClass, FlagSet, Int32, String, array<Object>[]()[][])
This method is intended for use only from generated code, and you should not use it in open code.
(Inherited from Persistent.)
GetChildren<(Of <<'(T>)>>)(IndexedList<(Of <<'(T>)>>), ObjectClass, String, array<Object>[]()[][])
This method is intended for use only from generated code, and you should not use it in open code.
(Inherited from Persistent.)
GetDefaultLayout()()()()
Finds the default layout for this object. This will always be of layout type Form.
(Inherited from Persistent.)
GetFieldValue(Int32)
Gets the value of the field backing the member with a particular slot number.
(Inherited from Session.)
GetHashCode()()()()
Serves as a hash function for a particular type.
(Inherited from Object.)
GetKey(Int32)
Returns property value for given key number.
(Inherited from Session.)
GetMemberValue(Int32)
Gets the value of the member property with a particular slot number.
(Inherited from Session.)
GetSelected<(Of <<'(T>)>>)(IndexedList<(Of <<'(T>)>>), ObjectClass, array<Object>[]()[][])
This method is intended for use only from generated code, and you should not use it in open code.
(Inherited from Persistent.)
GetType()()()()
Gets the Type of the current instance.
(Inherited from Object.)
InitialiseMembers(Boolean, Boolean)
In derived classes, initialises members of the Persistent object.
(Inherited from Persistent.)
IsAttached
Determines whether this object is attached to the persistent tree.
(Inherited from Persistent.)
IsDistributedFrom(Persistent)
Determines whether this object is held or is to be held in a different Database than another object.
(Inherited from Persistent.)
IsEmpty
Determines whether this is the Empty object of its class, as returned by the EmptyObject property.
(Inherited from Persistent.)
IsForeign
Gets a value determining whether this object is originally from a Domain other than the local Domain.
(Inherited from Persistent.)
IsInvalid
Gets a value indicating the validity of the current state of this object.
(Inherited from Persistent.)
IsModified
Gets a value indicating whether this object has been modified
(Inherited from Persistent.)
IsolationLevel
Gets or sets the isolation level to be used for all transactions in this session.

IsPersisted
Gets a value indicating whether the object has been persisted in a Database.
(Inherited from Persistent.)
IsProvisional
Gets a value indicating whether this object is still provisional - has not been persisted in a Database.
(Inherited from Persistent.)
LastActivity
Gets the date and time of the most recent OperationExecution or viewer to server communication in this Session.
(Inherited from Session.)
locker
This object is used to synchronise fetches of contained objects and collections in generated code.
(Inherited from Persistent.)
MemberwiseClone()()()()
Creates a shallow copy of the current Object.
(Inherited from Object.)
Modified
Occurs when an object is modified.
(Inherited from Persistent.)
Move(String, Persistent, String)
Moves this object from its current parent object to a new one.
(Inherited from Persistent.)
Move(String, Persistent, String, Int32)
Moves this object from its current parent object to a new one, optionally inserting it at a particular position in a collection.
(Inherited from Persistent.)
NominativeText
Gets a string containing values of nominative properties.
(Inherited from Session.)
ObjectNumber
This returns the object number part of the object's Reference.
(Inherited from Persistent.)
OnModified()()()()
Raises events signalling that the current object has been modified.
(Inherited from Persistent.)
OwningDomain
Gets the Domain to which this object originally belongs.
(Inherited from Persistent.)
Package
Property for package.
(Inherited from Session.)
Parent
This returns the parent object of this one.
(Inherited from Persistent.)
ParentPrincipal
Gets the Parent object as a Principal.
(Inherited from Session.)
ParentReference
Gets a Reference to this object's parent object.
(Inherited from Persistent.)
PingServer()()()()
Overridden only in viewer - pings server
(Inherited from Session.)
PreviousVersion
Returns the previous version of this object.
(Inherited from Persistent.)
Refresh()()()()
Gets the current value of this object from persistent storage.
(Inherited from Persistent.)
RefreshAndLock()()()()
Gets the current value of this object from persistent storage and sets a database lock.
(Inherited from Persistent.)
RefreshTree()()()()
Refreshes the entire persistent containment tree under this object.
(Inherited from Persistent.)
ReplaceSingleton(Persistent)
Replaces any current singleton object with a new one.
(Inherited from Session.)
ResolveReference
This event is raised whenever an IReference.DeReference fails to produce the referred to object.
(Inherited from Session.)
RestoreUnmodified(Boolean)
Restores the values of an object's members to those of the previous version.
(Inherited from Persistent.)
RunningPackage
Gets the Package which this Session is running.
(Inherited from Session.)
SaveToDatabase(Database, Reference, Object)
This method is intended for use only from generated code, and you should not use it in open code.
(Inherited from Persistent.)
SaveToMessage(Message)
Saves this Persistent object to a Message.
(Inherited from Persistent.)
SaveToMessage(Message, Boolean)
Saves this Persistent object to a Message.
(Inherited from Persistent.)
SessionEnding
This event is raised for all Sessions whenever the the session is ending
(Inherited from Session.)
SessionIsEnding
Gets a value indicating that this session is Ending.
(Inherited from Session.)
SetFieldValue(Int32, Object)
Sets the value of the field backing the member with a particular slot number.
(Inherited from Session.)
SetMemberFromMessage(Int32, Int32, Message)
This method is intended for use only from generated code, and you should not use it in open code.
(Inherited from Persistent.)
SetMemberValue(Int32, Object)
Sets the value of the member property with a particularn slot number.
(Inherited from Session.)
SetModified()()()()
Signals to Persistate that an object has been modified.
(Inherited from Persistent.)
SetModifiedSynced()()()()
Signals to Persistate that an object has been modified. The call is protected by a lock on this object.
(Inherited from Persistent.)
StandardDatabaseExceptionHandler
This DatabaseExceptionHandler is used whenever the DefaultDatabaseExceptionHandler has not been set in a session, and (for commits) no handler has been passed in an ExecutionResult.

StartedAt
The date and time at which the Session started.
(Inherited from Session.)
StartNewSession(UserInterface, Assembly, String)
Creates a new session, connected to a user interface.

StoreInDatabase(Database)
Marks this object so that it will be stored in a particular Database.
(Inherited from Persistent.)
ThisObj
This property is used in binding combo box selected values. It returns the current object.
(Inherited from Persistent.)
TitleText
Gets a title for this object.
(Inherited from Persistent.)
ToMetaReference()()()()
Creates a MetaReference referring to this object, if possible.
(Inherited from Persistent.)
ToMetaReference(Boolean)
Creates an environment relative MetaReference referring to this object, if possible.
(Inherited from Persistent.)
ToReference()()()()
Obtains a Reference to this Object.
(Inherited from Persistent.)
ToString()()()()
Obtains a string describing the object.
(Inherited from Persistent.)
TransactionListCounts()()()()
Retrieves the number of objects currently in the active execution's transaction lists.
(Inherited from Session.)
TransactionListCountTotal()()()()
Calculates the total number of outstanding items in all transaction lists.
(Inherited from Session.)
TransactionListsUpdated
This event occurs when one or more items are added to or removed from the lists of objects participating in the current transaction.
(Inherited from Session.)
Traverse(String)
Traverses the persistent object graph from this object using a period delimited navigation path.
(Inherited from Persistent.)
UI
Obtains the UserInterface object which gives access to the Session's user interface.
(Inherited from Session.)
UndoModifications(Boolean)
Undoes any object modifications which have been made since the start of the active Execution, or since the last call to Commit()()()() or UndoModifications(Boolean).
(Inherited from Session.)
Validate()()()()
Allows inheritors to create a validation method for Persistent classes.
(Inherited from Persistent.)
VersionNumber
Gets the version number of this object.
(Inherited from Persistent.)
WriteTestAssociations(IClassified, Int32, CreateTestDataParameterSet)
Creates test association(s) for an associated member of this object.
(Inherited from Persistent.)
WriteTestData(Persistent, Int32, CreateTestDataParameterSet)
Fills this object with test data.
(Inherited from Persistent.)
Remarks

DbaSessions are created only in the Server or in stand-alone ExecutionContexts. In the Viewer execution context, ViewerSessions are created instead.

This class has facilities to manage how database exceptions are dealt with, though in most cases you can leave the standard handler as the default. See ActiveDatabaseExceptionHandler, DefaultDatabaseExceptionHandler and StandardDatabaseExceptionHandler. You can also adjust the database IsolationLevel.

In a stand-alone context you use StartNewSession to create a new DbaSession, though in most cases, this is done for you in the generated StartUp class.

Usually, commits are performed automatically at the end of every Operation execution. However you can use the Commit method in this class to commit data to persistent storage part way through an execution.

Inheritance Hierarchy
Object
Persistent
 Session
  DbaSession

Assembly: Persistate (Module: Persistate) Version: 0.6.1.20 (0.6.1.20)