I've been told it's better practice to observe the
ModelAddedNotification, instead of setting it up in a constructor. I
guess the reason is that in case EOF needs to load the model again at
some later time for some reason it will work. I switched our stuff
to the notification way (was originally in constructor) and have no
complaints.
-- Jonathan
On Oct 24, 2008, at 2:09 PM, Ken Anderson wrote:
We do this in our base application class constructor:
NSMutableDictionary overrides = new NSMutableDictionary();
EOModel model =
EOModelGroup.defaultGroup().modelNamed("MyModel");
overrides.takeValueForKey(dbURL, "URL");
if (dbUser != null && dbPassword != null) {
overrides.takeValueForKey(dbUser, "username");
overrides.takeValueForKey(dbPassword, "password");
}
EODatabaseContext dbContext =
EODatabaseContext.forceConnectionWithModel(model, overrides, new
EOEditingContext());
On Oct 24, 2008, at 10:17 AM, William Sandner wrote:
We have 4 different environments that we deploy to, development,
test, staging, and production. We are using ant as our build tool.
For most of our environments we connect to a localhost database
with a common password, but production is on an external server
which has a more secure password. What is the best way to change
the db connection at build time?
Example:
When I build for production, I want to make sure the connection is
pointing to the correct server and the password is correct.
I know I can use ant to search and replace for connection string
tokens in the Properties file, but is this the easiest way?
--
William Sandner
+39 347 4090640 (mobile)
+39 023 6535381 (Milano)
+1 773 828 4363 (Chicago)
+1 773 326 0600 (Fax)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/kenlists%
40anderhome.com
This email sent to [EMAIL PROTECTED]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/jricker%40vt.edu
This email sent to [EMAIL PROTECTED]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]