Re: multiple model usage example
Re: multiple model usage example
- Subject: Re: multiple model usage example
- From: "Joe Little" <email@hidden>
- Date: Sun, 27 Jul 2008 22:28:33 -0700
On Wed, Jul 23, 2008 at 3:18 PM, Lachlan Deck <email@hidden> wrote:
> Hi Joe,
>
> See er.extensions.foundation.ConfigurationManager
> http://webobjects.mdimension.com/wonder/api/
>
Ok. I've banged my head on this one a lot. ConfigurationManager allows
you to change anything except for the database itself. Has anyone ever
connected to multiple, different databases at the same time. Nothing
in Wonder leads me to see an obvious programmatic way. My experience
is obviously at fault here. I tried to create a separate
model/connectiondictionary, etc. However, when I made a new
connectiondictionary from a previous one (NSMutableDictionary), and
tried to change the URL, it would always say that isn't possible at
run time since its immutable. I'm no its not. Oh well.
Any real examples or someone who has done this before?
An example snippet:
NSMutableDictionary conDictionary;
newModel = new
EOModel(NSBundle.bundleForName("AdmitArchEO").pathURLForResourcePath("admitarch.eomodeld"));
conDictionary = new
NSMutableDictionary(databaseConnectionDictionary(), true);
conDictionary.put("Url", appProperties().stringPropertyForKey("JDBCUrl2"));
newModel.setConnectionDictionary(conDictionary);
It fails at the put.
> On 24/07/2008, at 4:31 AM, Joe Little wrote:
>
>> And a quick additional note. I'm not trying to define multiple
>> databases to choose from, but multiple concurrent databases with
>> separate unique models. I want to read from one and create/modify
>> objects in another DB.
>>
>>
>> On Wed, Jul 23, 2008 at 11:14 AM, Joe Little <email@hidden> wrote:
>>>
>>> On Thu, Jul 10, 2008 at 10:31 PM, Lachlan Deck <email@hidden>
>>> wrote:
>>>>
>>>> On 11/07/2008, at 2:51 PM, Joe Little wrote:
>>>>
>>>>> I noticed on the confluence wiki a stub on advanced EOF for handling
>>>>> multiple models. I was wondering if anybody had sample code out there
>>>>> on how one generally goes about creating an application with
>>>>> connection dictionaries, etc, that allow one to access two databases
>>>>> at the same time. I've finally decided how I'm going to handle
>>>>> archiving in my active application, but first I need to handle older
>>>>> editions with older records. Doing it the database way, especially
>>>>> with relationships, is more than a chore, but its something that is
>>>>> more reasonable to consider within WO.
>>>>
>>>> If using Wonder:
>>>> dbConnectUserGLOBAL=...
>>>> dbConnectPasswordGLOBAL=...
>>>>
>>>> ##dbConnectURLGLOBAL=... for single connection
>>>>
>>>> # following has each EOModelName.URL. I'm using the same password hence
>>>> globally set above.
>>>>
>>>> DBa.URL=...
>>>> DBb.URL=...
>>>> DBc.URL=...
>>>> ....
>>>>
>>>> with regards,
>>>> --
>>>
>>> I switched a project to the newer Wonder (I had to previous use older
>>> ERExtension etc w/ my GVCFrameworks-based projects). Now I'm looking
>>> for a little more guidance. I know I need to establish the database
>>> connections to the multiple data stores early in the app, and my guess
>>> is that I should do this in Application, perhaps in the constructor?
>>> Practical WebObjects gives only examples in the singular DB case with
>>> multiple models, and so everything I gleam from that involves a single
>>> global DB name and not in any way the Wonder API way..
>>>
>>> Any more full fledged examples that can be shared?
>>>
>>>
>>>
>>>>
>>>> Lachlan Deck
>>>>
>>>>
>>>>
>>>>
>>>
>
> with regards,
> --
>
> Lachlan Deck
>
>
>
>
_______________________________________________
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