Menu

Couldn't insert object in unknown state Error

2005-07-05
2013-03-07
  • Nobody/Anonymous

    Hello, when im saving one object into database for the first time, appears this error Couldn't insert object in unknown state, trying to update... and then atoms try to update this object and there is an database error because this object isnt persistent.
    Why this error "unkown state"??

    Thanks a lot

     
    • Richard Banks

      Richard Banks - 2005-07-05

      When an object is saved the framework will first check the state of the object to determine if it is an existing object or a  new one.

      Under most circumstances the state is determined when the framework tries to retrieved an object from the database.

      In some csaes (mainly relating to adding items to collections) there is no initial check against the database performed and the framework is unsure as to what the current state of the object is.

      When the collection is saved, the framework will attempt to insert the object and if that fails, it will attempt to udpate the record instead.

      - Richard.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.