NHibernate - Two sessions to access the same database

This is related to the previous question I asked regarding splitting an asp.net mvc web application into two applications - one public and one administrator . Of course, both of them will use the same database.

With two web applications, I will have two host applications and two separate Nihbernate session sessions. I am worried that their separate data caches will cause all kinds of problems.

While posting this question, I considered this question , which covers a similar problem (for another reason). I really don't want to set up some sort of distributed cache just for a low-use application.

How can this be solved? Does the admin section share its own application, which is impossible in NHibernate without drastic measures?

Thank.

+5
source share
2 answers

We run this successfully, although some discrepancy in the data is always a problem. However, since the second level cache is configured for each site, you can disable it, as well as disable it for certain areas of the cache on your manager.

The second level cache will be read-only, since explicit updates will be flushed and saved directly.

, "" , - , . NHibernate , .

, concurrency , . , -:

Site will create orders, modify customers etc but only read products, prices and categories

Admin will modify orders, products, prices and categories but only read customers

NHibernate / , concurrency = "true" . , concurrency.

+1

, NHibernate .

, , . "Admin" ISessionFactory L2.

/ Factory, , 2 .

0

All Articles