Results 1 to 3 of 3

Thread: org.hibernate.NonUniqueObjectException

  1. #1
    Join Date
    Mar 2010
    Posts
    26

    Default org.hibernate.NonUniqueObjectException

    Hi,

    i am using hibernate.

    Below is the code, i am using

    sessionobject.saveOrUpdate(adminObject);
    sessionobject.saveOrUpdate(addressObject);
    sessionobject.saveOrUpdate(roleObject);

    then

    sessionobject.flush();
    tranObj.commit();

    But, when i am trying to edit and enter the same again , i am hitting this exception. Can any one advise on this.

  2. #2
    Join Date
    Dec 2006
    Posts
    311

    Default

    try using merge

  3. #3
    Join Date
    Aug 2008
    Posts
    105

    Default

    If you use merge, consider also to register Spring's IdTransferringMergeEventListener on your SessionFactory

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •