New Posts New Posts RSS Feed: Cocktail can support copying between databases?
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Cocktail can support copying between databases?

 Post Reply Post Reply
Author
giotis View Drop Down
Groupie
Groupie
Avatar

Joined: 26-Apr-2012
Location: Greece
Posts: 53
Post Options Post Options   Quote giotis Quote  Post ReplyReply Direct Link To This Post Topic: Cocktail can support copying between databases?
    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
Back to Top
mgood View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 18-Nov-2010
Location: Emeryville, CA
Posts: 583
Post Options Post Options   Quote mgood Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
giotis View Drop Down
Groupie
Groupie
Avatar

Joined: 26-Apr-2012
Location: Greece
Posts: 53
Post Options Post Options   Quote giotis Quote  Post ReplyReply Direct Link To This Post 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;
            }
        }


Edited by giotis - 05-Feb-2013 at 2:58pm
Back to Top
mgood View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 18-Nov-2010
Location: Emeryville, CA
Posts: 583
Post Options Post Options   Quote mgood Quote  Post ReplyReply Direct Link To This Post 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


Edited by mgood - 05-Feb-2013 at 8:14pm
Back to Top
giotis View Drop Down
Groupie
Groupie
Avatar

Joined: 26-Apr-2012
Location: Greece
Posts: 53
Post Options Post Options   Quote giotis Quote  Post ReplyReply Direct Link To This Post Posted: 06-Feb-2013 at 4:47am
     I currently deals with the construction of a QueryBuilder, any help?


Edited by giotis - 06-Feb-2013 at 1:52pm
Back to Top
mgood View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 18-Nov-2010
Location: Emeryville, CA
Posts: 583
Post Options Post Options   Quote mgood Quote  Post ReplyReply Direct Link To This Post 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.
 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down