I was wondering if anyone has attempted and been successful at using the Morphia jar for interacting with a mongodb database inside of GWT? I've been using the below object as the base for all my POJO's, however whenever I attempt to save down the object using an UpdateOperations<DerivedPersistentEntity> or datastore.Save() I get a ConcurrentModificationException.
package com.greycells.dateone.shared;
import com.google.code.morphia.annotations.Id;
import com.google.code.morphia.annotations.Version;
public class PersistentEntity {
@Id
private String id;
@Version
private Long version = null;
public PersistentEntity() {
}
public String getId() {
return id;
}
public Long getVersion() {
return version;
}
public void setVersion(Long version) {
this.version = version;
}
}
I've also added the gwt extension jar that you have to download separately for Morphia and referenced it in my gwt.xml and this seems to be of no help. Additionally I've tried changing the id field of PersistentEntity to the ObjectId type but then I can't even get my project to bind correctly because it complains of...
[ERROR] No source code is available for type org.bson.types.ObjectId; did you forget to inherit a required module?
datastore.Save()directly from your GWT client code ? That's probably not going to work. you have to transmit the DTO to your backend and there you have to calldatastore.save()- Ümit