Hi,

We're using several data models in the different projects we have. Each has it's own website and we go to each of them via a portal. Now we're creating a new web application that will be the main entrance for all reporting in all the projects.

Each of these domains uses a defaultschema: Projecten, Reporting, Controlit, etc.

I now use the following configuration in the web.config but I can only initialize the SessionManager once.

<Xtensive.Orm>
<domains>
  <!-- The PerformSafely attribute below can be overwritten in the DataContext.OpenSession() -->
  <domain name="Reporting" 
          provider="sqlserver"
          connectionString="Data Source=localhost;Initial Catalog=Controlit_Facturatie;Persist Security Info=True;Integrated Security=True;MultipleActiveResultSets=True"
          upgradeMode="PerformSafely">
    <types>
      <add assembly="Fortrus.Reporting.Model" />
    </types>
    <sessions>
      <session name="default" options="ServerProfile,AllowSwitching" />
    </sessions>
  </domain>
  <domain name="Projecten"
          provider="sqlserver"
          connectionString="Data Source=localhost;Initial Catalog=Controlit_Facturatie;Persist Security Info=True;Integrated Security=True;MultipleActiveResultSets=True"
          upgradeMode="PerformSafely">
    <types>
      <add assembly="Projecten.Model" />
    </types>
    <sessions>
      <session name="default" options="ServerProfile,AllowSwitching" />
    </sessions>
  </domain>
</domains>

</xtensive.orm>

We need to combine the different data models into one configuration that the SessionManager can handle. How do we do that?

Regards Paul

asked Mar 27 '13 at 06:44

Paul%20Sinnema's gravatar image

Paul Sinnema
261878896

edited Mar 27 '13 at 06:54


One Answer:

Hello Paul,

SessionManager intentionally supports only one Domain. Luckily it's sources are available and simple enough to borrow your own version.

However since there could be only one active session (i.e. Session.Current) you need to decide how to handle that. One of the possible solutions is to activate required session during controller calls (e.g. with custom controller action invoker).

answered Mar 28 '13 at 05:10

Denis%20Krjuchkov's gravatar image

Denis Krjuchkov
179325

edited Sep 02 '13 at 05:06

Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

Subscription:

Once you sign in you will be able to subscribe for any updates here

Tags:

×7
×3

Asked: Mar 27 '13 at 06:44

Seen: 127,025 times

Last updated: Sep 02 '13 at 05:06

powered by OSQA