• 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: compound primary key ("failed to provide new primary keys")
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: compound primary key ("failed to provide new primary keys")


  • Subject: Re: compound primary key ("failed to provide new primary keys")
  • From: Gavin Eadie <email@hidden>
  • Date: Sat, 14 Jun 2008 14:53:08 -0400

Thanks, Tom

... The locks don't influence the results

... The SQL involved is (and I've dumped the EC right before saveChanges() wherein the warning originates):

 About to set values in EO
  === Begin Internal Transaction
  evaluateExpression: "SELECT t0.OID, t0.MOST_RECENT_VISIT, t0.UNIQUE_NAME FROM JA_USER t0 WHERE t0.OID = ?" withBindings: 1:1(id)>
 1 row(s) processed
  === Commit Internal Transaction
 updating advert from null to [...]
 updating author from null to [...]
  === Begin Internal Transaction
  evaluateExpression: "SELECT t0.OID_AD, t0.OID_USER FROM JA_USER_AD t0 WHERE t0.OID_USER = ?" withBindings: 1:1(authorID)>
 2 row(s) processed
  === Commit Internal Transaction

 +-- EOEditingContext -- hasChanges--------------------------------------------------
 | registeredObjects() : 19
 |                     : Select
 |                     : Select
 |                     : Author
 |                     : Advert
 |                     : Advert
 |                     : Advert
 |                     : Advert
 |                     : Advert
 |                     : Advert
 |                     : Advert
 |                     : Advert
 |                     : Advert
 |                     : Advert
 |                     : Advert
 |                     : Advert
 |                     : Advert
 |                     : Advert
 |                     : Advert
 |                     : Select
 |   insertedObjects() : 1
 |                     : Select
 |    deletedObjects() : 0
 |    updatedObjects() : 2
 |                     : Advert
 |                     : Author

 EditingContextWillSaveChanges: done calling will*
 <com.webobjects.appserver._private.WOComponentRequestHandler>: Exception occurred while handling request:
java.lang.IllegalStateException: Adaptor com.webobjects.jdbcadaptor.JDBCAdaptor@9c9874 failed to provide new primary keys for entity 'Select'
[2008-6-14 13:20:14 EDT] <WorkerThread1> java.lang.IllegalStateException: Adaptor com.webobjects.jdbcadaptor.JDBCAdaptor@9c9874 failed to provide new primary keys for entity 'Select'
at com.webobjects.eoaccess.EODatabaseContext.prepareForSaveWithCoordinator(EODatabaseContext.java:5713)
at com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditingContext(EOObjectStoreCoordinator.java:370)
at com.webobjects.eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3192)
at er.extensions.eof.ERXEC._saveChanges(ERXEC.java:968)
at er.extensions.eof.ERXEC.saveChanges(ERXEC.java:891)
at edu.umich.marketplace.eof.UserSessionModel.addIntoSelectAdverts(UserSessionModel.java:212)


But my trouble is more conceptual, I think.  The two attributes in the connecting table are NOT primary keys (at least not on that table).  In order for Entity Modeler to be happy I have to say they are primary keys (no logical harm none -- it happens that they will always be a unique pair so they could be a double pkey).

Dilemma:
   If I say they ARE pkeys JDBCAdapter gets its knickers in a twist.
   If I say they are NT pkeys, then Entity Modeler growls in my ear!

Note, if in my test db I just add a real pkey, and don't say the two original attributes are, all is well -- I get no error and the database gets updated correctly.

Does this all break down to my not knowing how to calm Entity Modeler's fear of zero-pkey tables? ... Gav

On Jun 14, 2008, at 1:02 PM, Tom M. Blenko wrote:

The last time I saw this error it was because I had failed to define the name of the column in EOModeler (which I use). That doesn't appear to be the case for you. although I would normally lock on the primary keys of the correlation table (doubt that's the problem here).

I'm pretty sure this is a message directly back from the JDBC connector. I suggest looking at the SQL sent over (via EODebuggingEnabled), I'm pretty sure you'll see something wrong there -- which may not entirely bracket the problem but it is likely to get you close.

Tom


On Jun 14, 2008, at 9:31 AM, Gavin Eadie wrote:

I've twisted myself into a knot and would appreciate a little untangling help.
EOF makes so much easy that I get lulled into the idea that I know what I'm doing ...

 _______________________________________________
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

References: 
 >compound primary key ("failed to provide new primary keys") (From: Gavin Eadie <email@hidden>)

  • Prev by Date: Re: Webservices on Eclipse
  • Next by Date: Re: compound primary key ("failed to provide new primary keys")
  • Previous by thread: compound primary key ("failed to provide new primary keys")
  • Next by thread: Re: compound primary key ("failed to provide new primary keys")
  • Index(es):
    • Date
    • Thread