![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
This works fine unless the Remoting Server fails. In case of such a failure - e.g. if the client cannot connect to the server or if there is an error on the server - we want the clients to be able to switch to using their local copy of the business objects without human intervention. |
#3
| |||
| |||
|
|
Hi everybody, Here is the scenario: We have a number of web servers and although each one has a copy of the business objects required by our application, they connect and get their data from a Remoting server. (Benefits include centralized caching, single db access point, etc.) This works fine unless the Remoting Server fails. In case of such a failure - e.g. if the client cannot connect to the server or if there is an error on the server - we want the clients to be able to switch to using their local copy of the business objects without human intervention. How can we do this? Any suggestions? Cheers, Ekin |
#4
| |||
| |||
|
|
Looks like you need to employ the "Class Factory" pattern. This is a class that returns class instances to you. You can let the factory decide what style object it provides based on the available resources. Class factories are also highly recommended for use in remoting scenarios where you dont want to share the business object layer. James http://www.crainiate.net Ekin Caglar wrote: Hi everybody, Here is the scenario: We have a number of web servers and although each one has a copy of the business objects required by our application, they connect and get their data from a Remoting server. (Benefits include centralized caching, single db access point, etc.) This works fine unless the Remoting Server fails. In case of such a failure - e.g. if the client cannot connect to the server or if there is an error on the server - we want the clients to be able to switch to using their local copy of the business objects without human intervention. How can we do this? Any suggestions? Cheers, Ekin |
#5
| |||
| |||
|
|
"Ekin Caglar" <ekin (AT) sibilo (DOT) co.uk> wrote in news:eDXqwaW5GHA.1200 (AT) TK2MSFTNGP02 (DOT) phx.gbl: This works fine unless the Remoting Server fails. In case of such a failure - e.g. if the client cannot connect to the server or if there is an error on the server - we want the clients to be able to switch to using their local copy of the business objects without human intervention. Are your business objects located in a common layer (DLL) that the client has access to? In this case: Try If DisconnectedFlag = False Then MyObject = RemoteServer.GetSomeObject() Else MyObject = LocalFetch.GetSomeObject() End If Catch ex as exception MyObject = LocalFetch.GetSomeObject() DisconnectedFlag = True End Try Since the objects are located in a common layer - it doesn't matter who creates the objects or where the objects are created. |
#6
| |||
| |||
|
|
MyObject is already registered as a client activated object and if you try to create it, it will be fetched from the remoting server. And if the remoting server goes down for some reason, the fetching fails. |
#7
| |||
| |||
|
|
"Ekin Caglar" <ekin (AT) sibilo (DOT) co.uk> wrote in news:eEoabz#6GHA.1256 (AT) TK2MSFTNGP04 (DOT) phx.gbl: MyObject is already registered as a client activated object and if you try to create it, it will be fetched from the remoting server. And if the remoting server goes down for some reason, the fetching fails. Don't register the objects in the .config file? Rather create them as needed with Activator.GetObject (or declare them as local objects if the remoting connection fails). |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |