About Database Sessions in "Quadrant"
[This content is no longer valid. For the latest information on "M", "Quadrant", SQL Server Modeling Services, and the Repository, see the Model Citizen blog.]
In Microsoft code name “Quadrant”, database sessions affect the behavior of “Quadrant”, as explained in this topic.
What is a Session?
A session is a period of connectivity with a database. During a session, insertions, updates, and deletions can be made to the database. In “Quadrant” a session also provides a way to contain a set of changes and keep those changes separate from changes in other sessions. When you drag a table or record from a workpad, the changes made in the new workpad belong to the session of the original workpad. When you create a new workpad (by clicking New and Workpad on the File menu), the query you create runs against the database of an open session. This is explained in more detail below. For more information about creating sessions, see How to: Connect to a SQL Server Database with "Quadrant".
One Database, Multiple Sessions
“Quadrant” allows you to create multiple sessions on a single database. With multiple sessions, you can edit the same database in different sessions and commit those changes separately. You can see different versions of the same data in two (or more) sessions before you choose one version to commit.
For example, if you are managing the workloads of several people, you can open one session to assign tasks and a second session to change deadlines. You can compare the workloads in these two sessions before committing the data.
To save the changes in a particular session, select a workpad within that session and press CTRL+S. To determine which session a workpad belongs to, see How To: Determine the Current Session in "Quadrant". When you save the changes from one session, the data in other sessions will be out of sync with the database. Select an out-of-sync workpad and press F5 to get the newly-changed data. All workpads in the same session will reflect the changes. If there is a conflict, “Quadrant” notifies you, and you can resolve the conflict by using the changes list to select one of the following: the database value, the proposed value, or the original value. For more information about resolving conflicts, see How to: Resolve Change Conflicts in "Quadrant".
Sessions and Workpads Created With the New Command
When you create or open a workpad, the workpad shares the same session as that of the selected workpad. In the following example, you can join a session to the Quadrant or the Repository database depending on which workpad is selected.
On the View menu, click Explorer, and then click Repository.
On the View menu, click Explorer, and then click Quadrant.
You now have two workpads for two sessions.
Right-click the Repository workpad and click Query Bar to see the query. The top level query for every session is
vb(Database)
.Copy the query.
Select the Quadrant workpad.
On the File menu, click New, and then click Workpad.
A new blank workpad appears.
Paste the query into the box and press ENTER.
The workpad becomes a duplicate of the Quadrant workpad because the query was run against the Quadrant database.
Select the Repository workpad.
Create a new workpad and paste in the query.
The new workpad is a duplicate of the Repository workpad.
Subsequent queries run in the workpads will run in the context from which they were created. For an example using a query, see How to: Use Queries in "Quadrant".
Sessions: T-SQL Consoles
In a similar manner, the selected session determines a T-SQL console connection.
Select the Repository workpad.
On the File menu, click New, and then click T-SQL Console.
In the console, type #info and press ENTER.
The connection information shows the console is connected to the Repository database.
Select the Quadrant workpad.
On the File menu, click New, and then click T-SQL Console.
In the console, type #info and press ENTER.
The connection information shows the console is connected to the Quadrant database.
For more information about the T-SQL console, see How to: Use the T-SQL Console to Explore and Edit Data.
Sessions: Changes and Errors
The changes notification and error notifications are also affected by the currently selected session. For more information, see "Quadrant" Status Bar.
See Also
Tasks
How to: Connect to a SQL Server Database with "Quadrant"
How to: Use Queries in "Quadrant"
How to: Use the T-SQL Console to Explore and Edit Data