Re: ec.saveChages gives null exception (didn't before)
Re: ec.saveChages gives null exception (didn't before)
- Subject: Re: ec.saveChages gives null exception (didn't before)
- From: Chuck Hill <email@hidden>
- Date: Mon, 7 Mar 2005 20:28:20 -0800
On Mar 7, 2005, at 5:46 PM, Drew Thoeni wrote:
I've researched Chuck's idea (below) and EOModeler jdbc2info says I'm
using the right info (FrontBase). FYI, I'm not planning on changing
databases frequently.
I also followed up on Arturo's suggestion and my foreign keys are
marked as "NO" under "Deferrable" in "Check" in the table definition.
So, a couple of questions:
While this is a good idea, I doubt it is the cause of the exception
message below. The message below suggests that the error in either in
the jdbc2info or in how you have modeled an attribute. Double check
your model. Then check it again.
1) Can the "deferred" value be set in EOModeler and passed to the DB
via the SQL command in EOModeler?
No, this is not a function of EOModeler.
2) If not, (and this is really a Frontbase question) it appears you
can't modify this in Frontbase once it is set (must delete referential
rule and readd). Is this correct. Frontbase user's guide is silent on
this matter.
I believe that is correct. That is what I have always done in any case.
Chuck
Regards,
Drew
On Mar 7, 2005, at 12:37 PM, Chuck Hill wrote:
It is more likely what you have not done. When you connect to a
database in EOModeler, it caches some database specific information
to the connection dictionary under the jdbc2info key. If you later
change databases (as I recall you have) and don't use EOModeler to
connect to the new database, this jdbc2info will still be for the old
database. I'm not 100% sure that connecting to the new DB will
update this, it's not something I do frequently.
If you inspect the root node in the EOModel you should see this
jdbc2info key. Delete it and save the model. If you want you can
then connect to the new database and save the model, or EOF can
regenerate this information from the database each time it is run.
If you are going to switch back and forth a lot, I would try to avoid
saving this information in the model. Note that if it is not in the
model, EOF will keep two connections to the database open, one for
data and one for this information. In most cases this does not
matter, but it will in you are in a environment where the DB license
is on a per connection basis.
Chuck
On Mar 6, 2005, at 8:08 PM, Drew Thoeni wrote:
For quite some time, this method, and all others that save to the
Class table (like a classroom, not an object definition) worked
fine. I've looked at the SQL that is being generated and it appears
fine. There is only one not-null column in the table (the key) and
the failures are on updates to an existing record. Clearly,
something is null that should not be. And, it seems it's a result of
something I've done. But I've spent about an hour tinkering with
this and (probably in 10 minutes) reached my level of expertise.
Can anyone suggest what I might check into regarding this exception?
[2005-03-06 22:49:59 EST] <main> Waiting for requests...
[2005-03-06 22:58:35 EST] <WorkerThread8>
java.lang.NullPointerException
at
com.webobjects.jdbcadaptor.JDBCAdaptor.isValidQualifierType(JDBCAdapt
or.java:659)
at
com.webobjects.eoaccess.EODatabaseContext.isValidQualifierTypeForAttr
ibute(EODatabaseContext.java:5146)
at
com.webobjects.eoaccess.EODatabaseContext.lockingNonQualifiableAttrib
utes(EODatabaseContext.java:5160)
at
com.webobjects.eoaccess.EODatabaseContext.createAdaptorOperationsForD
atabaseOperationAttributes(EODatabaseContext.java:5346)
at
com.webobjects.eoaccess.EODatabaseContext.createAdaptorOperationsForD
atabaseOperation(EODatabaseContext.java:5520)
at
com.webobjects.eoaccess.EODatabaseContext.performChanges(EODatabaseCo
ntext.java:6337)
at
com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditin
gContext(EOObjectStoreCoordinator.java:411)
at
com.webobjects.eocontrol.EOEditingContext.saveChanges(EOEditingContex
t.java:3148)
at ClassAdmin.saveClass(ClassAdmin.java:63)
--
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
--
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