Re: EOUtilities.modelGroup exception?
Re: EOUtilities.modelGroup exception?
- Subject: Re: EOUtilities.modelGroup exception?
- From: Art Isbell <email@hidden>
- Date: Wed, 19 Jan 2005 10:15:28 -1000
On Jan 19, 2005, at 9:52 AM, Chuck Hill wrote:
I would not be inclined to connect like that. I don't recall what (if
any) the exact problems are, but catching the "model added"
notification is less likely to run into problems. It has always
worked for me. Example code is in Practical WebObjects (of course :-)
and here:
http://www.wocode.com/cgi-bin/WebObjects/WOCode.woa/1/wa/
ShareCodeItem?itemId=216&wosid=WCHJ9wqynVfl2a1qpO0tP0
I use the above approach in all of my WO apps to support easy changing
among test and production databases using a command-line argument or
Properties entry. Don't explicitly connect to the DB, just set the
connection dictionary and let EOF connect when it needs to.
On Jan 19, 2005, at 11:15 AM, William Hatch wrote:
I never had any problems with the EC being valid, and I'm connecting
using
the following code in the Application constructor:
dbKeys = new NSArray(new Object[]{"URL", "username", "password",
"driver",
"plugin"});
dbValues = new NSArray(new Object[]{DB_URL, "", "", "", ""});
EOModel aModel =
EOModelGroup.defaultGroup().modelNamed("UMAG1_03");
EOUtilities.connectWithModelNamed(new EOEditingContext(),
aModel.name(), new NSDictionary(dbValues, dbKeys));
EOUtilities' connectWithModelNamed() is documented as a method that
supports per-session database logins, yet you're invoking it in
Application with an editing context that won't be used in any session
and that hasn't been locked. Maybe none of this matters, but it
bothers me :-) And it's unnecessary.
Aloha,
Art
_______________________________________________
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