hibernate-ogm-core-4.1.0.Beta8
I get the following error with trying to execute a for loop that retrieves different items with collections of FileReference collections inside a Wildfly Container using the EntityManager.
@JsonIgnoreProperties(ignoreUnknown = true) @Entity public class Item {
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Type(type="objectid") private String id;
private String itemName; private String itemDescription;
private Date dateManufactured;
private Long bggId;
private String bggType;
@Transient private List<String> imageUrls;
@Transient private String condition;
public String getCondition() { return condition; }
public void setCondition(String condition) { this.condition = condition; }
public List<String> getImageUrls() { return imageUrls; }
public void setImageUrls(List<String> imageUrls) { this.imageUrls = imageUrls; }
public String getBggType() { return bggType; }
public void setBggType(String bggType) { this.bggType = bggType; }
public Long getBggId() { return bggId; }
public void setBggId(Long bggId) { this.bggId = bggId; }
@OneToMany(fetch=FetchType.EAGER) private List<FileReference> fileReferences;
public List<FileReference> getFileReferences() { return fileReferences; }
public void setFileReferences(List<FileReference> fileReferences) { this.fileReferences = fileReferences; }
public String getItemName() { return itemName; }
public void setItemName(String itemName) { this.itemName = itemName; }
public String getItemDescription() { return itemDescription; }
public void setItemDescription(String itemDescription) { this.itemDescription = itemDescription; }
public Date getDateManufactured() { return dateManufactured; }
public void setDateManufactured(Date dateManufactured) { this.dateManufactured = dateManufactured; }
public String getId() { return id; }
public void setId(String id) { this.id = id; }
}
at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:46) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23] at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83) [wildfly-weld-8.1.0.Final.jar:8.1.0.Final] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45) [wildfly-ee-8.1.0.Final.jar:8.1.0.Final] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) at org.jboss.as.ejb3.component.interceptors.NonPooledEJBComponentInstanceAssociatingInterceptor.processInvocation(NonPooledEJBComponentInstanceAssociatingInterceptor.java:59) [wildfly-ejb3-8.1.0.Final.jar:8.1.0.Final] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:273) [wildfly-ejb3-8.1.0.Final.jar:8.1.0.Final] ... 90 more Caused by: org.hibernate.HibernateException: Illegal attempt to associate a collection with two open sessions: com.abecorn.model.Item.fileReferences#54568df16e4afa85c8536ebf at org.hibernate.collection.internal.AbstractPersistentCollection.setCurrentSession(AbstractPersistentCollection.java:638) [hibernate-core-4.3.6.Final.jar:4.3.6.Final] at org.hibernate.event.internal.WrapVisitor.processCollection(WrapVisitor.java:66) [hibernate-core-4.3.6.Final.jar:4.3.6.Final] at org.hibernate.event.internal.AbstractVisitor.processValue(AbstractVisitor.java:121) [hibernate-core-4.3.6.Final.jar:4.3.6.Final] at org.hibernate.event.internal.WrapVisitor.processValue(WrapVisitor.java:125) [hibernate-core-4.3.6.Final.jar:4.3.6.Final] at org.hibernate.event.internal.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:76) [hibernate-core-4.3.6.Final.jar:4.3.6.Final] at org.hibernate.event.internal.DefaultFlushEntityEventListener.wrapCollections(DefaultFlushEntityEventListener.java:220) [hibernate-core-4.3.6.Final.jar:4.3.6.Final] at org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:157) [hibernate-core-4.3.6.Final.jar:4.3.6.Final] at org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:231) [hibernate-core-4.3.6.Final.jar:4.3.6.Final] at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:102) [hibernate-core-4.3.6.Final.jar:4.3.6.Final] at org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:61) [hibernate-core-4.3.6.Final.jar:4.3.6.Final] at org.hibernate.ogm.service.impl.AutoFlushBatchManagerEventListener.delegate(AutoFlushBatchManagerEventListener.java:34) [hibernate-ogm-core-4.1.0.Beta8.jar:4.1.0.Beta8] at org.hibernate.ogm.service.impl.AutoFlushBatchManagerEventListener.delegate(AutoFlushBatchManagerEventListener.java:21) [hibernate-ogm-core-4.1.0.Beta8.jar:4.1.0.Beta8] at org.hibernate.ogm.service.impl.BatchManagerEventListener.onEvent(BatchManagerEventListener.java:41) [hibernate-ogm-core-4.1.0.Beta8.jar:4.1.0.Beta8] at org.hibernate.ogm.service.impl.AutoFlushBatchManagerEventListener.onAutoFlush(AutoFlushBatchManagerEventListener.java:29) [hibernate-ogm-core
|