You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Marc Logemann (JIRA)" <ji...@apache.org> on 2008/07/14 19:34:31 UTC
[jira] Created: (OPENJPA-659) No state snapshot is available on
@Embedded class when using runtime enhancement via spring-tomcat-weaver
No state snapshot is available on @Embedded class when using runtime enhancement via spring-tomcat-weaver
----------------------------------------------------------------------------------------------------------
Key: OPENJPA-659
URL: https://issues.apache.org/jira/browse/OPENJPA-659
Project: OpenJPA
Issue Type: Bug
Components: kernel
Affects Versions: 1.1.0
Environment: Tomcat6, Java6, Mac OS X, Spring 2.5
Reporter: Marc Logemann
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();
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (OPENJPA-659) No state snapshot is available on
@Embedded class when using runtime enhancement via spring-tomcat-weaver
Posted by "Pinaki Poddar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-659?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pinaki Poddar reassigned OPENJPA-659:
-------------------------------------
Assignee: Pinaki Poddar
> No state snapshot is available on @Embedded class when using runtime enhancement via spring-tomcat-weaver
> ----------------------------------------------------------------------------------------------------------
>
> Key: OPENJPA-659
> URL: https://issues.apache.org/jira/browse/OPENJPA-659
> Project: OpenJPA
> Issue Type: Bug
> Components: kernel
> Affects Versions: 1.1.0
> Environment: Tomcat6, Java6, Mac OS X, Spring 2.5
> Reporter: Marc Logemann
> Assignee: Pinaki Poddar
>
> 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();
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OPENJPA-659) No state snapshot is available on
@Embedded class when using runtime enhancement via spring-tomcat-weaver
Posted by "Pinaki Poddar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12613396#action_12613396 ]
Pinaki Poddar commented on OPENJPA-659:
---------------------------------------
What is the identity strategy used by Order.class?
While reproducing the error in JSE environment, I am noticing that the crucial factor is the datastore identity used by a class. Otherwise, the issue does not seem to appear.
> No state snapshot is available on @Embedded class when using runtime enhancement via spring-tomcat-weaver
> ----------------------------------------------------------------------------------------------------------
>
> Key: OPENJPA-659
> URL: https://issues.apache.org/jira/browse/OPENJPA-659
> Project: OpenJPA
> Issue Type: Bug
> Components: kernel
> Affects Versions: 1.1.0
> Environment: Tomcat6, Java6, Mac OS X, Spring 2.5
> Reporter: Marc Logemann
>
> 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();
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (OPENJPA-659) No state snapshot is available on
@Embedded class when using runtime enhancement via spring-tomcat-weaver
Posted by "Pinaki Poddar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-659?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pinaki Poddar resolved OPENJPA-659.
-----------------------------------
Resolution: Fixed
Revision 676727:
Dirty checking fails for runtime enhanced classes. The original case reported the failure in a Spring-Tomcat-Weaver with Embdded field. But as TestSimpleUnenhancedQuery can raise the same failure in a simpler settings. The fix is related to initializing a SaveFieldManager conditional to having loaded fields at invocation of saveFields(). The fix removes the condition and ensures that a SaveFieldManager is assocaited even when saveFields() is invoked without any field loaded.
> No state snapshot is available on @Embedded class when using runtime enhancement via spring-tomcat-weaver
> ----------------------------------------------------------------------------------------------------------
>
> Key: OPENJPA-659
> URL: https://issues.apache.org/jira/browse/OPENJPA-659
> Project: OpenJPA
> Issue Type: Bug
> Components: kernel
> Affects Versions: 1.1.0
> Environment: Tomcat6, Java6, Mac OS X, Spring 2.5
> Reporter: Marc Logemann
> Assignee: Pinaki Poddar
>
> 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();
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OPENJPA-659) No state snapshot is available on
@Embedded class when using runtime enhancement via spring-tomcat-weaver
Posted by "Marc Logemann (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12613383#action_12613383 ]
Marc Logemann commented on OPENJPA-659:
---------------------------------------
The problem doesnt occur when relying on build time enhancement via PCEnhancerTask.
> No state snapshot is available on @Embedded class when using runtime enhancement via spring-tomcat-weaver
> ----------------------------------------------------------------------------------------------------------
>
> Key: OPENJPA-659
> URL: https://issues.apache.org/jira/browse/OPENJPA-659
> Project: OpenJPA
> Issue Type: Bug
> Components: kernel
> Affects Versions: 1.1.0
> Environment: Tomcat6, Java6, Mac OS X, Spring 2.5
> Reporter: Marc Logemann
>
> 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();
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (OPENJPA-659) No state snapshot is available on
@Embedded class when using runtime enhancement via spring-tomcat-weaver
Posted by "Michael Dick (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-659?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Dick updated OPENJPA-659:
---------------------------------
Fix Version/s: 1.2.0
> No state snapshot is available on @Embedded class when using runtime enhancement via spring-tomcat-weaver
> ----------------------------------------------------------------------------------------------------------
>
> Key: OPENJPA-659
> URL: https://issues.apache.org/jira/browse/OPENJPA-659
> Project: OpenJPA
> Issue Type: Bug
> Components: kernel
> Affects Versions: 1.1.0
> Environment: Tomcat6, Java6, Mac OS X, Spring 2.5
> Reporter: Marc Logemann
> Assignee: Pinaki Poddar
> Fix For: 1.2.0
>
>
> 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();
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.