• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: EOUtilities.modelGroup exception?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EOUtilities.modelGroup exception?


  • Subject: Re: EOUtilities.modelGroup exception?
  • From: Chuck Hill <email@hidden>
  • Date: Wed, 19 Jan 2005 11:52:41 -0800

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



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));


Where DB_URL is a string I get from System.getProperties...blah blah and
then I just set the connection string as either a launch arg or in the
properties file. Been working quite well, but I was thinking that maybe
this does "something bad" based on the earlier trace. Now, one of the
fetch's involved is a model fetch, so maybe the two don't go too well
together? However, this fetch is used all over the app, and this is the
only place that this exception is occurring. Thanks Chuck.



Chuck Hill1/19/05 12:58 email@hidden

Are you certain that the EC parameter passed is good (not null, not
disposed, etc. etc.)?  How are you connecting to database now?

Chuck


On Jan 19, 2005, at 9:16 AM, William Hatch wrote:

I recently changed the way I'm connecting to the database, and now I'm
getting the following exception on a sporadic basis:


java.lang.NullPointerException
at
com.webobjects.eoaccess.EOUtilities.modelGroup(EOUtilities.java:997)
at
com.webobjects.eoaccess.EOUtilities.objectsWithFetchSpecificationAndB in
dings
(EOUtilities.java:112)
at com.datadynamicsofcny.Day.getDaysInRange(Day.java:228)
at
com.datadynamicsofcny.UserRequest.setUpDays(UserRequest.java:567)
at NewRequest.addRequest(NewRequest.java:124)


...

I'm not sure this has anything to do with the database, but the ...modelGroup has me wondering what the problem might be. Thanks. -- William Hatch Eng. Visual Media Collection Cornell Lab of Ornithology Macaulay Library Voice (607) 254-2116 Fax (607) 254-2439 http://birds.cornell.edu/macaulaylibrary


-- William Hatch Eng. Visual Media Collection Cornell Lab of Ornithology Macaulay Library Voice (607) 254-2116 Fax (607) 254-2439 http://birds.cornell.edu/macaulaylibrary



--
Practical WebObjects - a book for intermediate WebObjects developers who want to increase their overall knowledge of WebObjects, or those who are trying to solve specific application development problems.
http://www.global-village.net/products/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


  • Follow-Ups:
    • Re: EOUtilities.modelGroup exception?
      • From: Art Isbell <email@hidden>
References: 
 >Re: EOUtilities.modelGroup exception? (From: William Hatch <email@hidden>)

  • Prev by Date: Re: EOUtilities.modelGroup exception?
  • Next by Date: Re: EOUtilities.modelGroup exception?
  • Previous by thread: Re: EOUtilities.modelGroup exception?
  • Next by thread: Re: EOUtilities.modelGroup exception?
  • Index(es):
    • Date
    • Thread