Hi All,

we are trying to convert an existing application to use the OpenbasePKPlugin.

We have included the driver and plugin details in the model and the application successfully starts and
for some entities a primary key is generated without using the EO_PK_TABLE.

but we get "NEWID FOR null ID" when we try and insert a new row into a particular table The tablename is included in the entity, it has a primary key defined with a unique index.


error exert:
251819 [WorkerThread8] INFO er.transaction.adaptor.Exceptions - Database Exception occured: com.webobjects.jdbcadaptor.JDBCAdaptorException: EvaluateExpression failed: <com.webobjects.jdbcadaptor.OpenBasePlugIn$OpenBaseExpression: "NEWID FOR null ID">: Next exception:SQL State:42000 -- error code: 0 -- msg: SQL ERROR - [position 9, near ' ' in 'NEWID FOR null ID'] newid failed - a table name was expected but was not found.

SQL: [EMAIL PROTECTED]
251819 [WorkerThread8] WARN NSLog - <com.webobjects.appserver._private.WOComponentRequestHandler>: Exception occurred while handling request: com.webobjects.jdbcadaptor.JDBCAdaptorException: EvaluateExpression failed: <com.webobjects.jdbcadaptor.OpenBasePlugIn$OpenBaseExpression: "NEWID FOR null ID">: Next exception:SQL State:42000 -- error code: 0 -- msg: SQL ERROR - [position 9, near ' ' in 'NEWID FOR null ID'] newid failed - a table name was expected but was not found.

SQL: [EMAIL PROTECTED]
[2008-07-24 11:10:13 CST] <WorkerThread8> com.webobjects.jdbcadaptor.JDBCAdaptorException: EvaluateExpression failed: <com.webobjects.jdbcadaptor.OpenBasePlugIn$OpenBaseExpression: "NEWID FOR null ID">: Next exception:SQL State:42000 -- error code: 0 -- msg: SQL ERROR - [position 9, near ' ' in 'NEWID FOR null ID'] newid failed - a table name was expected but was not found.

SQL: [EMAIL PROTECTED]
at com.webobjects.jdbcadaptor.JDBCContext._jdbcErrorWithChannel(JDBCContext.java:138) at com.webobjects.jdbcadaptor.JDBCChannel._evaluateExpression(JDBCChannel.java:310) at com.webobjects.jdbcadaptor.JDBCChannel.evaluateExpression(JDBCChannel.java:261) at com.webobjects.jdbcadaptor.OpenBasePKPlugIn.newPrimaryKeys(OpenBasePKPlugIn.java:68) 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.ERXEC._saveChanges(ERXEC.java:937)
   at er.extensions.ERXEC.saveChanges(ERXEC.java:860)
at CEContributorsEditingComponent.setACompetencyIsUsedForATarget(CEContributorsEditingComponent.java:91)
.....


code exert:

   public void setACompetencyIsUsedForATarget( boolean set) {
       if ( set && !aCompetencyIsUsedForATarget() && sourceObject!=null) {
aCEContributor = (CEContributorTraining)EOUtilities.createAndInsertInstance(sourceObject.editingContext(), "CEContributorTraining"); aCEContributor.addObjectToBothSidesOfRelationshipWithKey(aCompetency, "toIndividualCompetency"); if (aCETypeTarget!=null) aCEContributor.addObjectToBothSidesOfRelationshipWithKey(aCETypeTarget.toCEType(), "toCEType"); sourceObject.addObjectToBothSidesOfRelationshipWithKey(aCEContributor, "toCEContributors");
       }


Can anyone assist?

Environment:
Openbase 10.0.10
Leopard 10.5.3
WebObjects 5.3
Eclipse 3.3.2



Thanks in advance

Shelley

_______________________________________________
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