|
|
|
Supreme Being
      
Group: Forum Members
Last Login: 2011-11-23 02:03:59
Posts: 80,
Visits: 730
|
|
I have a 3tier ECO III .NET remoting application with the appserver running as a NT service. I used to sync the client ecospaces using the PersistenceMapperProvider with a SyncHandler on the server side and using PersistenceMapperClient on the client sides. At the same time I have a few house keeping threads running on the server sides as well each with its own ecoSpace connected using .NET remoting.
Later I think using .NET remoting for different threads running on the very same process is pretty well... stupid and indeed a waste of resources. So I decided to start using some kind of standalone ecoSpaces (i.e. with own sqlConnection and persistenceMapper) for those threads. The only problem is that the client ecoSpaces and those standalone one inside the threads are no longer synchronized which is not a big deal for me. I just wonder if there is any way to get all of the ecoSpaces synchronized and what is the disadvantage in the current setup?
|
|
|
|
|
Supreme Being
      
Group: Administrators
Last Login: 2010-11-30 12:17:13
Posts: 1 230,
Visits: 1 382
|
|
yes, just replace the PersistenceMapperClient with a PersistenceMapperSharer. If the PersistenceMapperProvider is running in the same process, this is the component to use.
They should possibly have been named like this:
PMClient -> RemotePMPClient
PMSharer -> LocalPMPClient
/Jonas Hogstrom [CapableObjects]
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: 2011-11-23 02:03:59
Posts: 80,
Visits: 730
|
|
Thanks for the suggestion but I get and error by using the PersistenceMapperSharer:
'Provider already in use with other type system'.
Any clue?
|
|
|
|
|
Supreme Being
      
Group: Administrators
Last Login: 2010-11-30 12:17:13
Posts: 1 230,
Visits: 1 382
|
|
Do you have more than one EcoSpace in your project? Make sure the EcoSpace that is referenced by the PersistenceMapperProvider is the same as the one used for your in-process server stuff.
The PMP uses an ecospace only to get a reference to a model, it will not instantiate or activate an ecospace by itself.
/Jonas Hogstrom [CapableObjects]
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: 2011-11-23 02:03:59
Posts: 80,
Visits: 730
|
|
| Hi Jonas, I have been using 2 EcoSpace types in the server. I have changed one of the simple testing project to using only one EcoSpace as you suggested (e.g. ServerEcoSpace, being referenced by the PersistenceMapperProvider) and put a PersistenceMapperSharer on it. Although the project can run but running EcoDebugger using ServerEcoSpace show nothing in any class while the ecoSpace connected via .NET remoting correctly shows the data. Perhaps I have done something wrong?
|
|
|
|
|
Supreme Being
      
Group: Administrators
Last Login: 2010-11-30 12:17:13
Posts: 1 230,
Visits: 1 382
|
|
Did you activate the ecospace? did you enable the WinformDequeuer in the server project?
Activation of the winform dequeuer is done in the main project file in the eco winform project template:
using Eco.Windows.Forms;
WinFormDequeuer.Active = true;
In Eco5, the EcoSpaceDebugger has been improved so when you start it with an inactive ecospace or with an inactive dequeuer, it will let you know (and you can activate both from the debugger directly).
/Jonas Högström
/Jonas Hogstrom [CapableObjects]
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: 2011-11-23 02:03:59
Posts: 80,
Visits: 730
|
|
That is it How silly I was.... missed the very first step in activating the ecoSpace 
BTW, I used to call DBEvolutionForm.EvolveDB to evolve the database in code. It works fine in most cases but it seems that it won't save the OR mapping to the database if there is no action needed? (e.g. change of a field from non-nullable to nullable). Is there anyway to force it to save the updated mapping info back to the database?
|
|
|
|
|
Supreme Being
      
Group: Administrators
Last Login: 2010-11-30 12:17:13
Posts: 1 230,
Visits: 1 382
|
|
Yes, there is a method on the PersistenceMapper component:
persistenceMapperSqlServer1.SaveMappingInfo(ITypeSystemService typeSystemService)
this method will save the current mapping to the database.
/Jonas Hogstrom [CapableObjects]
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: 2011-11-23 02:03:59
Posts: 80,
Visits: 730
|
|
Thanks Jonas, it works great now
|
|