Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-659

No state snapshot is available on @Embedded class when using runtime enhancement via spring-tomcat-weaver

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1.0
    • 1.2.0
    • kernel
    • None
    • Tomcat6, Java6, Mac OS X, Spring 2.5

    Description

      i am getting this exception:

      org.springframework.orm.jpa.JpaSystemException: No state snapshot is available for instance of type "de.logentis.bwh.model.Payment", but this instance uses state-comparison for dirty detection.; nested exception is <openjpa-1.1.0-r422266:657916 fatal general error> org.apache.openjpa.persistence.PersistenceException...

      Here are the relevant pieces of the casses:

      @Entity
      @Table(name = "orders")
      @VersionColumn(name = "_version")
      public class Order {
      ...
      @Embedded
      Payment payment;
      }

      @Embeddable
      public class Payment {

      @Basic
      @Enumerated(EnumType.STRING)
      @Column(name = "paymenttype")
      PaymentType type;

      @Column(name = "currency")
      String currency;

      @Column(name = "pricing")
      String pricing;

      @Column(name = "cost")
      int cost;
      }

      The point is, persisting is no problem at all, the exception will be thrown by issueing:

      Query query = getEntityManager().createQuery("select o FROM Order o");
      query.getResultList();

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            ppoddar@apache.org Pinaki Poddar
            logemann Marc Logemann
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment