org.hibernate.HibernateException: immutable natural identifier of an instance of org.hibernate.auction.AuctionItem was altered

Hibernate JIRA | michael jenik | 1 decade ago
  1. 0

    The eg example fails : Changing auction item description for: 8 Hibernate: select auctionite0_.id as id0_, auctionite0_.seller as seller0_0_, auctionite0_.description as descript3_0_0_, auctionite0_.ends as ends0_0_, auctionite0_.condition as condition0_0_, auctionite0_.successfulBid as successf6_0_0_ from AuctionItem auctionite0_ where auctionite0_.id=? Exception in thread "main" org.hibernate.HibernateException: immutable natural identifier of an instance of org.hibernate.auction.AuctionItem was altered at org.hibernate.event.def.DefaultFlushEntityEventListener.checkNaturalId(DefaultFlushEntityEventListener.java:75) at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:116) at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:187) at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:73) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:736) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:330) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86) at Main.changeItemDescription(Main.java:195) at Main.main(Main.java:385) This is caused because the exaple code is trying to change the value of "Description" . "Description" is maped in the following way. <natural-id> <many-to-one name="seller"/> <property name="description" length="200"/> </natural-id> Like it is a natural-id , it is immutable, and an exception has benn programed for this case. Regards

    Hibernate JIRA | 1 decade ago | michael jenik
    org.hibernate.HibernateException: immutable natural identifier of an instance of org.hibernate.auction.AuctionItem was altered
  2. 0

    The eg example fails : Changing auction item description for: 8 Hibernate: select auctionite0_.id as id0_, auctionite0_.seller as seller0_0_, auctionite0_.description as descript3_0_0_, auctionite0_.ends as ends0_0_, auctionite0_.condition as condition0_0_, auctionite0_.successfulBid as successf6_0_0_ from AuctionItem auctionite0_ where auctionite0_.id=? Exception in thread "main" org.hibernate.HibernateException: immutable natural identifier of an instance of org.hibernate.auction.AuctionItem was altered at org.hibernate.event.def.DefaultFlushEntityEventListener.checkNaturalId(DefaultFlushEntityEventListener.java:75) at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:116) at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:187) at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:73) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:736) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:330) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86) at Main.changeItemDescription(Main.java:195) at Main.main(Main.java:385) This is caused because the exaple code is trying to change the value of "Description" . "Description" is maped in the following way. <natural-id> <many-to-one name="seller"/> <property name="description" length="200"/> </natural-id> Like it is a natural-id , it is immutable, and an exception has benn programed for this case. Regards

    Hibernate JIRA | 1 decade ago | michael jenik
    org.hibernate.HibernateException: immutable natural identifier of an instance of org.hibernate.auction.AuctionItem was altered
  3. 0

    Click on button(form:form) twice causing hibernate exception

    Stack Overflow | 3 years ago | user2170172
    org.springframework.orm.hibernate3.HibernateSystemException: identifier of an instance of XXX was altered from 1 to null; nested exception is org.hibernate.HibernateException: identifier of an instance of XXX was altered from 1 to null
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Hibernate exception :org.hibernate.HibernateException: Flush during cascade is dangerous

    Stack Overflow | 3 years ago | BMB
    org.hibernate.HibernateException: Flush during cascade is dangerous
  6. 0

    HSQL - HIBERNATE. org.hibernate.HibernateException: identifier of an instance of "....Author.class" was altered from 1 to null

    Stack Overflow | 3 years ago | user3271450
    org.hibernate.HibernateException: identifier of an instance of com.maven.vaadin.bookshelf.Author was altered from 1 to null

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.hibernate.HibernateException

      immutable natural identifier of an instance of org.hibernate.auction.AuctionItem was altered

      at org.hibernate.event.def.DefaultFlushEntityEventListener.checkNaturalId()
    2. Hibernate
      SessionImpl.managedFlush
      1. org.hibernate.event.def.DefaultFlushEntityEventListener.checkNaturalId(DefaultFlushEntityEventListener.java:75)
      2. org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:116)
      3. org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:187)
      4. org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:73)
      5. org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
      6. org.hibernate.impl.SessionImpl.flush(SessionImpl.java:736)
      7. org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:330)
      7 frames
    3. Hibernate
      JDBCTransaction.commit
      1. org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86)
      1 frame
    4. Unknown
      Main.main
      1. Main.changeItemDescription(Main.java:195)
      2. Main.main(Main.java:385)
      2 frames