openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Rak (JIRA)" <j...@apache.org>
Subject [jira] Commented: (OPENJPA-1422) Cannot use @Embeddable as @MapKey
Date Wed, 09 Dec 2009 02:24:18 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-1422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12787878#action_12787878
] 

Richard Rak commented on OPENJPA-1422:
--------------------------------------

Here is the stack trace when executing the given test case on 1.2.1:

<openjpa-1.2.1-rexported nonfatal user error> org.apache.openjpa.persistence.InvalidStateException:
Encountered unmanaged object in persistent field "org.apache.openjpa.persistence.jdbc.maps.embeddedkey.Folio.folioItems<key:class
org.apache.openjpa.persistence.jdbc.maps.embeddedkey.FolioItemPK>" during flush.  However,
this field does not allow cascade persist. Set the cascade attribute for this field to CascadeType.PERSIST
or CascadeType.ALL (JPA annotations) or "persist" or "all" (JPA orm.xml), or enable cascade-persist
globally, or manually persist the related field value prior to flushing. You cannot flush
unmanaged objects or graphs that have persistent associations to unmanaged objects.
FailedObject: org.apache.openjpa.persistence.jdbc.maps.embeddedkey.FolioItemPK@213c2d7f
	at org.apache.openjpa.kernel.SingleFieldManager.preFlushPC(SingleFieldManager.java:754)
	at org.apache.openjpa.kernel.SingleFieldManager.preFlushPCs(SingleFieldManager.java:735)
	at org.apache.openjpa.kernel.SingleFieldManager.preFlush(SingleFieldManager.java:670)
	at org.apache.openjpa.kernel.SingleFieldManager.preFlush(SingleFieldManager.java:562)
	at org.apache.openjpa.kernel.SingleFieldManager.preFlush(SingleFieldManager.java:478)
	at org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:2829)
	at org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:39)
	at org.apache.openjpa.kernel.StateManagerImpl.beforeFlush(StateManagerImpl.java:960)
	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1948)
	at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1908)
	at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1826)
	at org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81)
	at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1350)
	at org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:877)
	at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:512)
	at org.apache.openjpa.persistence.jdbc.maps.embeddedkey.TestEmbeddedMapKey.testEmbeddedMapKey(TestEmbeddedMapKey.java:51)
<snip>


> Cannot use @Embeddable as @MapKey
> ---------------------------------
>
>                 Key: OPENJPA-1422
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1422
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 1.2.1
>         Environment: Linux x64
>            Reporter: Richard Rak
>         Attachments: Folio.java, FolioItem.java, FolioItemPK.java, FolioPK.java, TestEmbeddedMapKey.java
>
>
> Executing the attached test case fails on OpenJPA 1.2.1, however, it succeeds on trunk.
 I have not tested 1.3.0.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message