Hello,

I have the following very strange (for me) problem.

I have a very simple component and a straight forward save method, like  

theTrial = new Trials();
ec.insertObject(theTrial);

… set some values in to the new record ...


ec.saveChanges();

When there are no records in to the table, first record is always saved 
correctly and PK takes the value of 1; After that, when I try to create and 
save a new record I always take the following error

IllegalArgumentException: Array is empty
  at com.webobjects.foundation.NSArray.objectAtIndex(NSArray.java:377)
  at com.webobjects.jdbcadaptor.JDBCPlugIn.newPrimaryKeys(JDBCPlugIn.java:777)
     ... skipped 3 stack elements
  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:1085)
  at er.extensions.eof.ERXEC.saveChanges(ERXEC.java:1007)
  at 
webcore.app.components.ConfigurationComponent.saveTrial(ConfigurationComponent.java:714)
  ... skipped 44 stack elements

The strange thing is that when I delete EO_PK_TABLE corresponding record, 
either manually or from inside code like

String pkString = new String ("delete from EO_PK_TABLE where NAME = 'Trials'");
NSArray deletePK = EOUtilities.rawRowsForSQL(ec, "MyModel", pkString, null);

and try to save, new records are saved normally, without any problem and PK is 
increasing accordingly.

Also, certainly I have no problem saving records to other tables of database 
from inside the same component. Also I can not realize any other problem 
running my application.

I would appreciated to have some help on this if possible.

Many thanks in advance

Stavros Panidis

PS

Development environment

Mac OS X 10.7
MySQL 5.5.13
JDBC connector 5.1.17




 _______________________________________________
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]

Reply via email to