SQL error on saving changes
SQL error on saving changes
- Subject: SQL error on saving changes
- From: Florijan Stamenkovic <email@hidden>
- Date: Wed, 17 May 2006 16:08:44 +0200
Hi all,
I have a Photo entity. That entity stores the creation date,
thumbnail, relates to a user, carries a unique number used for file
naming (NOT primary key), primary key, etc... A file is stored in the
file system. Pretty much standard stuff. It is used in a Java Client
scenario, where the photo data, thumbnail, user identification and
creation date are arguments to an RMI call to the server, where the
record is created and saved. On the saveChanges() call on the server
side I get an SQL error. But only sometimes. There seem to be some
images what cause the error, after which any image will cause the
error. I can save any number of records if it is not one of the *bad*
images, after which the exception is thrown for any save. If I start
with the *bad* image, the error is there immediately, so there is no
relation to the amount of images saved. The images are originating
from the same camera, are of the same format, and size does not seem
to be an issue. Both the thumbnails and whole images are viewable and
are not causing problems while still on the client side...
And, on top of all this: this is a totally new error. I have been
using the same application for a while now, stored hundreds of images
in the same way, and did not get this error. On the same platform I
am using now (I don't even think there were an OpenBase update or so
in between).
Platform:
Intel iMac
OS X 10.4.6
WO 5.3
Java 1.5 (forcing the projects back to 1.4.2 doesn't help)
OpenBase 9.1.5
Any ideas??? Below is the server side exception where
(Session.clientSideRequestSavePhoto(Session.java:203)) is a call to
editingContext.saveChanges(). Below the exception is the Photo entity.
TIA,
Flor
com.webobjects.eoaccess.EOGeneralAdaptorException: EvaluateExpression
failed: <com.webobjects.jdbcadaptor.OpenBasePlugIn
$OpenBaseExpression: "INSERT INTO PHOTO(CREATION_DATE, USER_ID,
UNIQUE_NUMBER, THUMBNAIL, PHOTO_ID, IS_DELETED) VALUES
(?, ?, ?, ?, ?, ?)" withBindings: 1:2005-01-25 13:23:20
(creationDate), 2:2(userID), 3:8(uniqueNumber), 4:<NSData:
length=1712,
data=FFD8FFE000104A46494600010200000100010000...4CDF6D71BB9D8D853F5159AD
5D8E88FBDB9FFFD9>(thumbnail), 5:16423(photoID), 6:0(isDeleted)>:
Next exception:SQL State:42000 -- error code: 0 -- msg: SQL
ERROR - [position 106, near 'E' in ' (1.283486E+8, 2, 8, 'qra']
insert error: comma expected but not found in data.
SQL: INSERT INTO PHOTO(CREATION_DATE, USER_ID, UNIQUE_NUMBER,
THUMBNAIL, PHOTO_ID, IS_DELETED) VALUES (1.283486E+8, 2, 8,
'qraaa000', 16423, 0)
at
com.webobjects.eoaccess.EODatabaseContext._exceptionWithDatabaseContextI
nformationAdded(EODatabaseContext.java:4685)
at com.webobjects.eoaccess.EODatabaseContext.performChanges
(EODatabaseContext.java:6393)
at
com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditingCo
ntext(EOObjectStoreCoordinator.java:415)
at com.webobjects.eocontrol.EOEditingContext.saveChanges
(EOEditingContext.java:3226)
at Session.clientSideRequestSavePhoto(Session.java:203)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.webobjects.foundation.NSSelector.invoke(NSSelector.java:354)
at com.webobjects.foundation.NSSelector._safeInvokeSelector
(NSSelector.java:108)
at
com.webobjects.eodistribution.common._EOServerInvocation.doInvokeWithTar
get(_EOServerInvocation.java:140)
at
com.webobjects.eodistribution.EODistributionContext._processClientReques
t(EODistributionContext.java:488)
at
com.webobjects.eodistribution.EODistributionContext.responseToClientMess
age(EODistributionContext.java:577)
at
com.webobjects.eodistribution.WOJavaClientComponent.handleClientRequest(
WOJavaClientComponent.java:1105)
at com.webobjects.eodistribution.WOJavaClientComponent.invokeAction
(WOJavaClientComponent.java:343)
at
com.webobjects.appserver._private.WOComponentReference.invokeAction
(WOComponentReference.java:104)
at
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction
(WODynamicGroup.java:101)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction
(WODynamicGroup.java:110)
at com.webobjects.appserver.WOComponent.invokeAction
(WOComponent.java:945)
at com.webobjects.appserver.WOSession.invokeAction(WOSession.java:1168)
at com.webobjects.appserver.WOApplication.invokeAction
(WOApplication.java:1375)
at
com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWit
hPreparedPage(WOComponentRequestHandler.java:196)
at
com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWit
hPreparedSession(WOComponentRequestHandler.java:287)
at
com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWit
hPreparedApplication(WOComponentRequestHandler.java:322)
at
com.webobjects.appserver._private.WOComponentRequestHandler._handleReque
st(WOComponentRequestHandler.java:358)
at
com.webobjects.appserver._private.WOComponentRequestHandler.handleReques
t(WOComponentRequestHandler.java:435)
at com.webobjects.appserver.WOApplication.dispatchRequest
(WOApplication.java:1306)
at com.webobjects.appserver._private.WOWorkerThread.runOnce
(WOWorkerThread.java:173)
at com.webobjects.appserver._private.WOWorkerThread.run
(WOWorkerThread.java:254)
at java.lang.Thread.run(Thread.java:613)
{
attributes = (
{
columnName = "CREATION_DATE";
externalType = datetime;
name = creationDate;
valueClassName = NSCalendarDate;
valueType = T;
},
{
columnName = "IS_DELETED";
externalType = int;
name = isDeleted;
valueClassName = NSNumber;
valueType = i;
},
{
columnName = "PHOTO_ID";
externalType = int;
name = photoID;
valueClassName = NSNumber;
valueType = i;
},
{
allowsNull = Y;
columnName = "PROJECT_ID";
externalType = int;
name = projectID;
valueClassName = NSNumber;
valueType = i;
},
{
columnName = THUMBNAIL;
externalType = object;
name = thumbnail;
valueClassName = NSData;
},
{
allowsNull = Y;
columnName = "UNIQUE_NUMBER";
externalType = int;
name = uniqueNumber;
valueClassName = NSNumber;
valueType = i;
},
{
columnName = "USER_ID";
externalType = int;
name = userID;
valueClassName = NSNumber;
valueType = i;
}
);
attributesUsedForLocking = (photoID, userID, projectID);
className = "com.havaso.JCPhotoSuite.server.eo.Photo";
classProperties = (thumbnail, user, uniqueNumber, project,
creationDate, isDeleted, punchItems);
externalName = PHOTO;
fetchSpecificationDictionary = {};
internalInfo = {
"_clientClassPropertyNames" = (
Attribute,
uniqueNumber,
fileName,
thumbnail,
user,
photoProjects,
uniqueNumber,
project,
creationDate,
isDeleted,
punchItems
);
"_javaClientClassName" =
"com.havaso.JCPhotoSuite.client.eo.Photo";
};
name = Photo;
primaryKeyAttributes = (photoID);
relationships = (
{
destination = Project;
isToMany = N;
joinSemantic = EOInnerJoin;
joins = ({destinationAttribute = projectID;
sourceAttribute = projectID; });
name = project;
},
{
deleteRule = EODeleteRuleDeny;
destination = PunchItem;
isToMany = Y;
joinSemantic = EOInnerJoin;
joins = ({destinationAttribute = photoID;
sourceAttribute = photoID; });
name = punchItems;
},
{
destination = User;
isMandatory = Y;
isToMany = N;
joinSemantic = EOInnerJoin;
joins = ({destinationAttribute = userID; sourceAttribute
= userID; });
name = user;
}
);
}
_______________________________________________
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