Print Page | Close Window

Cocktail can support copying between databases?

Printed From: IdeaBlade
Category: Cocktail
Forum Name: Community Forum
Forum Discription: A professional application framework using Caliburn.Micro and DevForce
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3977
Printed Date: 22-Jun-2026 at 6:07pm


Topic: Cocktail can support copying between databases?
Posted By: giotis
Subject: Cocktail can support copying between databases?
Date Posted: 05-Feb-2013 at 2:10pm
I know that IdeaBlade supports copying between two databases, (I have see the sample)
can be done this under cocktail and how?

many thanks



Replies:
Posted By: mgood
Date Posted: 05-Feb-2013 at 2:26pm
I'm assuming that the sample you refer to uses two EntityManagers with different datasource extensions to connect to different databases and then queries the data from the first EM adds it to the second EM and saves. 

First of all that's about the most inefficient way of copying data. That's a huge overhead just to copy data. You better handle this at the database level.

Anyway, if you want to do it this way, you just create two EntityManagerProviders with different ConnectionOptions.


Posted By: giotis
Date Posted: 05-Feb-2013 at 2:54pm
something like this ?

      

public CopyDataViewModel(IResourceMgtUnitOfWork UnitOfWork)    {

            IGlobalCache globalCache = new GlobalCache(SecondManagerProvider);
            IResourceMgtUnitOfWork uow = new ResourceMgtUnitOfWork(SecondManagerProvider, globalCache);

            var items = UnitOfWork.StaffingResource.AllAsync();
 
            .... and after ?
            .... How can do the copying?
           

        }

        [Export]
        public IEntityManagerProvider<TempHireEntities> SecondManagerProvider    {
            get   {
                var provider = new EntityManagerProvider<TempHireEntities>();
                provider.Configure(config => config.WithConnectionOptions(ConnectionOptions.Second.Name));
                return provider;
            }
        }


Posted By: mgood
Date Posted: 05-Feb-2013 at 8:12pm
giotis,
You are asking for consulting advice that goes beyond product feature support. Using DevForce/Cocktail for the purpose of copying data from one database to another is quite unorthodox and not a feature of the product as such. Please understand that we have a consulting team for these kinds of questions as outlined in the rules of engagement post. I'll gladly answer questions about specific features of Cocktail/DevForce in this forum, but for further advise on how to implement a feature like this, I have to refer you to our consulting organization. 

http://www.ideablade.com/forum/forum_posts.asp?TID=3772&title=please-read-rules-of-engagement


Posted By: giotis
Date Posted: 06-Feb-2013 at 4:47am
     I currently deals with the construction of a QueryBuilder, any help?


Posted By: mgood
Date Posted: 06-Feb-2013 at 6:02am
We have a whole chapter on building dynamic queries on our DRC that provides the foundation for a QueryBuilder.
 
http://drc.ideablade.com/devforce-2012/bin/view/Documentation/dynamic-queries - http://drc.ideablade.com/devforce-2012/bin/view/Documentation/dynamic-queries



Print Page | Close Window