Re: Saving uploaded file data to database
Re: Saving uploaded file data to database
- Subject: Re: Saving uploaded file data to database
- From: Pascal Robert <email@hidden>
- Date: Tue, 3 Apr 2007 14:26:22 -0400
If FrontBase works like Oracle DB for BLOB, it will first create a
pointer for the BLOB, and enter the data after, so I guess you cannot
put NOT NULL constraint on BLOB without problems.
I'm back! Setting the filePath binding fixed the problem I was
having, but now I'm on to a new one.
My EOModel contains a String, a CLOB, two NSTimestamps and two
BLOBs (actually the blobs are in their own model). Each of the
corresponding components is bound to them, like so:
Description : WOText {
value = newPanel.description;
}
ImageFile : WOFileUpload {
filePath = imageFileName;
mimeType = imageMimeType;
data = newPanelImages.big_image;
}
This works fine for everything except the BLOBs, which are tripping
the "not null" constraint on those fields in the database.
I have code to check the length of newPanelImages.big_image and it
is correct, but somehow it's not working. Here's how I'm doing the
save:
EOEditingContext ec = session().defaultEditingContext();
ec.insertObject(newPanelImages);
ec.saveChanges();
And, just in case I'm misinterpreting something, here's the error:
com.webobjects.eoaccess.EOGeneralAdaptorException:
EvaluateExpression failed: : Next exception:SQL State:23 subclass =
00 -- error code: 357 -- msg: Exception condition 357. Integrity
constraint violation (CHECK, PANELIMAGES._C0000000007(\"bigImage\"
IS NOT NULL)). Next exception:SQL State:23 subclass = 00 -- error
code: 357 -- msg: Exception condition 357. Integrity constraint
violation (CHECK, PANELIMAGES._C0000000009(\"thumbnail\" IS NOT
NULL)). Next exception:SQL State:40 subclass = 00 -- error code:
363 -- msg: Exception condition 363. Transaction rollback.
It's like the data is not getting copied from the newPanelImages
object to the database. Is there something special one has to do
to handle BLOBs in FrontBase?
thanks,
_______________________________________________
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