Re: Using database objects in different schemas
Re: Using database objects in different schemas
- Subject: Re: Using database objects in different schemas
- From: Paul Hoadley <email@hidden>
- Date: Sat, 16 Dec 2017 09:24:34 +1030
Hi Chuck,
On 16 Dec 2017, at 6:17 am, Chuck Hill <email@hidden> wrote:
> I think you can make it work, but it is going to need a database connection
> for each slave. And there can’t be relationships between slaves or between
> the master and the slave. And it is going to be susceptible to “bad
> assumption” errors in Wonder (I think that version of EOF is OK).
>
> What you would need to do is to create a new EOModelGroup for each slave and
> copy (not a reference, a brand new object) the models into it, adding the
> schema to the table names. That avoids the need to tweak the SQL. They you
> need to create a new EOObjectStoreCoordinator for each of these groups.
> EOObjectStoreCoordinators don’t co-operate so the duplicate GID should be OK.
> Then make sure that your code uses the correct EOObjectStoreCoordinator to
> create EOEditingContexts in.
>
> I *think* that will work, I have never tried it. Using the
> EOSharedEditingContext with objects in the slave tables is going to
> challenging as a lot of code is going to assume that there is only one, not
> per EOObjectStoreCoordinator. I’d avoid the EOSharedEditingContext. The
> other place where you may run into problems is notifications that are not
> scoped to the EOObjectStoreCoordinator.
>
> But all in all, this is not really what EOF is meant for. With EOF you would
> use a different data model for this sort of multi-tenant solution.
Does all of this require “deep” knowledge at the application level of what’s
going on in the database? To get it set up, as you describe above, obviously it
does, but then beyond that, say André wants a particular Foo object—does he
need to know where to ask for it from? Or say he wants all Foo objects—doesn’t
he now need to go ask for all Foos from each stack? I got the impression from
the original post that he wanted a kind of merged view over all these tables,
which presumably just isn’t possible.
--
Paul Hoadley
https://logicsquad.net/
https://www.linkedin.com/company/logic-squad/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden