Hi,

Our scenario is such that - for our central web services, we are currently 
using a distributed caching solution with our NHibernate implementation for 
the 2nd Level Cache.

Sometimes, our caching server goes down, due which we get an NHibernate 
exception in our web service, based on which we do the following:
1. If its a caching server related exception, we go into failover mode and 
rebuild our NHibernate Session Factory without 2nd Level Caching support
2. Throw an unrecoverable exception to the client of our web service

When traffic is high, we get a number of such exceptions on our web service 
client.

Going forward we want to ensure that no exception gets thrown to the 
client, so we are thinking about doing the following:
1. Keep 2 instances of the NHibernate Session Factory - One with 2nd Level 
Cache support and one without.
2. On a Caching server exception, retry the request by using the Factory 
without the 2nd Level Cache support, until the Caching server comes back 
online, and then resume using the factory with 2nd level Cache support

So, basically we would be switching between both the NHibernate Session 
Factories on the fly.

Would be great if somebody could:
1. Give any pointers on handling the failover of NHibernate's 2nd Level 
Cache
2. Point out any pitfalls of switching the Session Factories on the fly

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/nhusers/-/fUnsGRHw6PUJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to