• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Saving uploaded file data to database
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Saving uploaded file data to database


  • Subject: Saving uploaded file data to database
  • From: Janine Sisk <email@hidden>
  • Date: Tue, 3 Apr 2007 11:22:01 -0700

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

 _______________________________________________
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

  • Follow-Ups:
    • Re: Saving uploaded file data to database
      • From: Mike Schrag <email@hidden>
    • Re: Saving uploaded file data to database
      • From: Chuck Hill <email@hidden>
    • Re: Saving uploaded file data to database
      • From: Pascal Robert <email@hidden>
  • Prev by Date: Re: EditingContext/Sorting Problem SOLVED
  • Next by Date: Re: Saving uploaded file data to database
  • Previous by thread: Re: WOWODC
  • Next by thread: Re: Saving uploaded file data to database
  • Index(es):
    • Date
    • Thread