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 = ""> }
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,
janine
|