• 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
RE: Problems updating a row
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Problems updating a row


  • Subject: RE: Problems updating a row
  • From: "Jonathan Fleming" <email@hidden>
  • Date: Fri, 11 Jun 2004 15:19:50 +0100

From: "Alberto de Arriba" <email@hidden>
To: <email@hidden>
Subject: Problems updating a row
Date: Fri, 11 Jun 2004 15:00:42 +0200

Hi all, I've been reading you for some months and this is my first post.

I have a problem in a form with a WOFileUpload component. When the form is
submitted it throws the following exception:

Error:  com.webobjects.eoaccess.EOGeneralAdaptorException:
updateValuesInRowDescribedByQualifier --
com.webobjects.jdbcadaptor.JDBCChannel method failed to update row in
database
Reason:  updateValuesInRowDescribedByQualifier --
com.webobjects.jdbcadaptor.JDBCChannel method failed to update row in
database


In the action method I have this code:

if (uploadedData != null && uploadedData.length()>0)
      data.takeStoredValueForKey(uploadedData,"photograph");
session().defaultEditingContext().saveChanges();

Hi Alberto, try this it might help (not tested - written in email window):

if (uploadedData != null && uploadedData.length()>0) {
try {
if ((uploadedData.length()==0) && (uploadedData.length()>0)){
//do nothing, keep old uploaded data in iVar
} else if ((uploadedData.length()==0) && (uploadedData.length()==0)){
uploadedData = null;
} else {
data.takeValueForKey(uploadedData,"photograph");
}
}
catch (NullPointerException npEx){ /*your message*/; }
}
}


Jonathan :^)


uploadedData is an instance variable of type NSData used to hold the file contents. If i comment out the first two lines it does perform the saveChanges correctly, so I think it must have something to do with NSData handling.

Any suggestion?


Thanks in advance.
Alberto.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.



_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger today! http://www.msn.co.uk/messenger
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.



  • Follow-Ups:
    • Re: Problems updating a row
      • From: "Alberto de Arriba" <email@hidden>
  • Prev by Date: Problems updating a row
  • Next by Date: Binding in WObrowser
  • Previous by thread: Problems updating a row
  • Next by thread: Re: Problems updating a row
  • Index(es):
    • Date
    • Thread