• 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
Problem getting primary keys
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem getting primary keys


  • Subject: Problem getting primary keys
  • From: Miguel Arroz <email@hidden>
  • Date: Tue, 3 Feb 2009 17:54:02 +0000

Hi!

I'm having the following problem when adding two objects to the database:

Feb 03 17:48:27 (ERXDatabaseContextDelegate.java:160) INFO er.transaction.adaptor.Exceptions - Database Exception occured: java.lang.IllegalArgumentException: Array is empty
Feb 03 17:48:27 (ERXNSLogLog4jBridge.java:40) INFO NSLog - Array is empty
java.lang.IllegalArgumentException: Array is empty
at com.webobjects.foundation.NSArray.objectAtIndex(NSArray.java:392)
at com .webobjects .eoaccess .EOAdaptorChannel .dictionaryWithObjectsForAttributes(EOAdaptorChannel.java:1269)
at com.webobjects.jdbcadaptor.JDBCChannel.fetchRow(JDBCChannel.java: 1408)
at com .webobjects .jdbcadaptor.PostgresqlPlugIn.newPrimaryKeys(PostgresqlPlugIn.java:189)
at com .webobjects .jdbcadaptor .JDBCChannel.primaryKeysForNewRowsWithEntity(JDBCChannel.java:537)
at com .webobjects .eoaccess .EODatabaseContext ._batchNewPrimaryKeysWithEntity(EODatabaseContext.java:5900)
at com .webobjects .eoaccess .EODatabaseContext .prepareForSaveWithCoordinator(EODatabaseContext.java:5883)
at com .webobjects .eocontrol .EOObjectStoreCoordinator .saveChangesInEditingContext(EOObjectStoreCoordinator.java:409)
at com .webobjects .eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3226)
at er.extensions.eof.ERXEC._saveChanges(ERXEC.java:981)
at er.extensions.eof.ERXEC.saveChanges(ERXEC.java:903)


  The SQL log says:

Feb 03 17:48:27 (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - === Begin Internal Transaction
Feb 03 17:48:27 (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - evaluateExpression: <com.webobjects.jdbcadaptor.PostgresqlExpression: "SELECT NEXTVAL('address_seq') AS KEY1, NEXTVAL('address_seq') AS KEY0">
Feb 03 17:48:27 (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - fetch canceled
Feb 03 17:48:27 (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - 0 row(s) processed
Feb 03 17:48:27 (ERXNSLogLog4jBridge.java:46) DEBUG NSLog - === Commit Internal Transaction


Note the "fetch canceled". What the heck is this? The query works when used in the database command line, and the exact same code works in other parts of the application.

An interesting fact may be that I'm using EOUtilites.rawRowsForSQL before the saveChanges, in the same RR loop, but in a different editing context.

  Any ideas? I'm kinda stuck on this one...

  Yours

Miguel Arroz
...........................
http://www.survs.com

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: Problem getting primary keys
      • From: Miguel Arroz <email@hidden>
  • Prev by Date: Re Prefetching
  • Next by Date: Re: Problem getting primary keys
  • Previous by thread: Re Prefetching
  • Next by thread: Re: Problem getting primary keys
  • Index(es):
    • Date
    • Thread