Synchronization of ecoSpaces
CapableObjects Forums
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Synchronization of ecoSpaces Expand / Collapse
Author
Message
Posted 2008-10-13 04:26:20


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme 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?
Post #573
Posted 2008-10-13 07:57:20
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme 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]
Post #574
Posted 2008-10-13 10:59:16


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme 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?
Post #576
Posted 2008-10-14 08:52:20
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme 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]
Post #581
Posted 2008-10-14 17:54:48


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme 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?
Post #586
Posted 2008-10-15 12:36:00
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme 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]
Post #588
Posted 2008-10-17 18:33:13


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme 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?
Post #597
Posted 2008-10-17 19:01:29
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme 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]
Post #598
Posted 2008-10-21 08:06:04


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 2011-11-23 02:03:59
Posts: 80, Visits: 730
Thanks Jonas, it works great now
Post #611
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: HansKarlsen, Jonas Hogstrom, PeterMorris

Permissions Expand / Collapse

All times are GMT +1:00, Time now is 11:27

Powered By InstantForum.NET v4.1.4 © 2012
Execution: 0,313. 9 queries. Compression Disabled.