Re: Different Database Connection per session for the same model
Re: Different Database Connection per session for the same model
- Subject: Re: Different Database Connection per session for the same model
- From: Henrique Prange <email@hidden>
- Date: Mon, 18 Jun 2012 15:53:11 -0300
Paul,
Maybe this project can be helpful. I created it following Chuck's advice. It's very experimental, but works. Sorry for the lack of comments in the source code.
https://github.com/hprange/multi-tenant-prototype
Cheers,
Henrique
On 18/06/2012, at 15:13, Chuck Hill wrote:
> I have never done this, but I think it can be done. You will need to create new EOModelGroups, load/copy the models from the default group, set the connection information, and create a new EOObjectStoreCoordinator from that new model group. You need to be very careful in your code (and in any Wonder code that you call) to NOT call default* methods as most use the OSC for the default model group. Not what you want. Then in each session/page, create an editing context in the desired OSC. Again, avoid use of the defaultEditingContext to avoid confusion.
>
>
> Chuck
>
>
> On 2012-06-18, at 9:32 AM, Paul Dunkler wrote:
>
>> Hi List,
>>
>> is there any way to have different database connections per session? I need this in an application for giving the user the ability to change between several different copies of the database to work on.
>>
>> I always tried to copy EOModels and so on, read some mails from the list but not really found an answer for that problem. I know that what i trying to do will cause a bit memory overhead but i do not want to provide ~25 applications just because they need different database connections.
>>
>> Would be nice to get some suggestions...
>>
>> --
>> With best regards
>> Paul Dunkler
>> _______________________________________________
>> 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
>
> --
> Chuck Hill Senior Consultant / VP Development
>
> Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
> http://www.global-village.net/gvc/practical_webobjects
>
>
>
>
>
>
>
>
>
> _______________________________________________
> 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
_______________________________________________
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