I am trying to persist and ArrayList, but it does not work. Everything
is great locally [M/S db], but when I deploy it [HR] then objects do
not persist. Any ideas why? It’s really weird and I cannot find any
solution.
I use JDO with DataNucleus and Guice for injections, here is required code:
@Persistent(defaultFetchGroup = "true", serialized="true")
private ArrayList<ArrayList<Long>> colonisations = new
ArrayList<ArrayList<Long>>();
at User class
Another class, that tries to persist the data:
@Inject
public Repository<User> userRepo;
...
...
MySession.get().getUser().getColonisations().add(colonisation);
...
...
Colonisation.this.userRepo.persist(MySession.get().getUser());
The only hint I am getting from logs is:
org.datanucleus.ObjectManagerImpl close: Outstanding nontx update
being committed to datastore
Making the field dirty solves the issue, so DataNucleus sees that it’s been changed.