Oracle® OLAP DML Reference 10g Release 2 (10.2) Part Number B14346-02 |
|
|
View PDF |
When an analytic workspace is attached in multiwriter mode, the RELEASE command changes the access mode of the specified variables, relations, valuesets, or dimensions from read/write (acquired) access to read-only access.
Syntax
RELEASE objects
Arguments
One or more variables, relations, valuesets, dimension names, or analytic workspace names, separated by commas, that you want to release. Precede each analytic workspace names with AW using the following syntax:
AW analytic workspace name
When you specify an analytic workspace in this list, all acquired objects in that analytic workspace are released after all pending changes are made to them. All changes made to the variables, relations, valuesets, or dimensions before a RELEASE statement executes are preserved as private changes after the release statement.
Notes
Releasing Non-Updated Objects
Similarly to using an AW DETACH statement for analytic workspaces that has been updated. Using RELEASE for objects that have been updated does not allow others to acquire the object until you commit or roll back the transaction. It may still be useful to release an object that has been updated before a commit when one wants to make further what-if changes and later needs to use UPDATE statement to update all acquired variables.
Releasing a Dimension Causes the Dimension to Revert
When you release an acquired dimension, the dimension is automatically reverted (see REVERT for an explanation of what it means to revert a dimension).
As the following code illustrates, releasing an acquired dimension causes an automatic revert.
User A issues the following OLAP DML statements.
AW ATTACH myworkspace MULTI ACQUIRE RESYNC time WAIT MAINTAIN time ADD 'Y2002' actuals (time 'Y2002', ...) = 37 REPORT time --> ..., 'Y2002' ... report SHOW actuals (time 'Y2002', ...) --> 37 RELEASE time REPORT time --> ... (no 'Y2002') AW ATTACH myworkspace MULTI ... report ACQUIRE RESYNC actuals, time WAIT MAINTAIN time ADD 'Y2002' actuals (time 'Y2002', ...) = 37 REPORT time --> ..., 'Y2002' SHOW actuals (time 'Y2002', ...) --> 37 ... report REVERT time REPORT time --> ... (no 'Y2002') MAINTAIN time ADD 'Y2002' ... report REPORT time --> ..., 'Y2002' SHOW actuals (time 'Y2002', ...) --> NA ... report
Examples
Example 22-13 Two Users Modifying Different Objects in the Same Analytic Workspace
A classic use of multiwriter attachment mode is to allow two users to modify two different objects in the same analytic workspace. For example, assume that an analytic workspace has two variables: actuals
and budget
. Assume also that one user (user A) wants to modify actuals
, while another user (user B) wants to modify budget
. In this case, after attaching the analytic workspace in the multiwriter mode, each user acquires the desired variable, performs the desired modification, updates, commits the changes, and then, either detaches the workspace or releases the acquired variable.
User A executes the following statements.
AW ATTACH myworkspace MULTI ACQUIRE actuals ... make modifications UPDATE MULTI actuals COMMIT RELEASE actuals AW DETACH myworkspace
While, at the same time, User B executes the following statements.
AW ATTACH myworkspace MULTI ACQUIRE budget ... make modifications UPDATE MULTI budget COMMIT RELEASE budget AW DETACH myworkspace
Example 22-14 Using RELEASE After UPDATE But Before COMMIT
Using a RELEASE statement does not always allow other users to acquire the released variable. For example, when you have updated a variable but have not committed the changes, the execution of a RELEASE statement has no effect on other users until a commit occurs. However, when you use a simple UPDATE to update all acquired variables, it can be useful to release a variable after updating it but before committing it. When a variable is released after the first update, it is not be included in the list of updated variables for the second update. The following code illustrates situations where user B1 releases budget
at different times.
Assume that User B1 issues the following statements
AW ATTACH myworkspace MULTI ACQUIRE RESYNC budget WAIT make changes C1 RELEASE budget UPDATE make changes C2 UPDATE COMMIT
User B2 could issue the following statements
AW ATTACH myworkspace MULTI ACQUIRE RESYNC budget WAIT
User B2 gets budget
and sees no changes and issues the following statements.
... AW ATTACH myworkspace MULTI ACQUIRE RESYNC budget WAIT make changes C1 UPDATE RELEASE budget make changes C2 UPDATE COMMIT ... AW ATTACH myworkspace MULTI ACQUIRE RESYNC budget WAIT
Alternatively, User B2 gets budget
and sees changes C1 and issues the following statements.
AW ATTACH myworkspace MULTI ACQUIRE RESYNC budget WAIT make changes C1 UPDATE make changes C2 RELEASE budget UPDATE COMMIT ... AW ATTACH myworkspace MULTI ACQUIRE RESYNC budget WAIT
Or, as another alternative, User B2 gets budget
and sees changes C1 and issues the following statements.
AW ATTACH myworkspace MULTI ACQUIRE RESYNC budget WAIT make changes C1 UPDATE make changes C2 UPDATE COMMIT RELEASE budget ... AW ATTACH myworkspace MULTI ACQUIRE RESYNC budget WAIT
At this point, User B2 gets budget
and sees changes C2