Databases Reference
In-Depth Information
Database Developer
writes custom code in
procedural language
SessionOpenedEvent
Managed Stored
Procedure is deployed
to Analysis Server
Analysis Services
User creates
a session
(if UserA)
Create Member A
(if UserB)
Create Member B
Else
SessionOpenedEvent
(if UserA)
Create Member A
(if UserB)
Create Member B
Else
Create Member C
Create Member C
FIGURE 14.9
Process to create a stored procedure with a callback.
In Analysis Services 2008, stored procedures can subscribe to the four events shown in
Table 14.6. Your code can subscribe to events using mechanism of events and delegates
provided by .NET Framework.
TABLE 14.6
Callback Plug-In Events
Name
Description
Demand
A new user session is
created on the server.
SessionOpened
Context.Server.SessionOpened
User's session is
about to be closed.
SessionClosing
Context.Server.SessionClosing
First time a cube is
queried by a session.
CubeOpened
Context.CurrentConnection.CubeOpened
No more queries will
be served for this
cube on the session.
CubeClosing
Context.CurrentConnection.CubeClosing
To tell Analysis Services which class contains callbacks, you can use the custom attribute
[PluginAttribute] . Analysis Services 2008 extends the server object model interface with
new functions, which you can use to specify a callback function that the server calls on a
certain events. Listing 14.4 shows an example of a library that implements a personaliza-
tion plug-in.
LISTING 14.4
Stored Procedure That Implements a Plug-In
namespace PasTestPlugIn
 
Search WWH ::




Custom Search