About merge

forum_thread

Cascading persistence through an inverse field

Hi! I was playing with cascading persistence with @ManyToMany and inverse @ManyToMany fields, and I noticed that I can only get cascading persistence in one direction. If the "owner" of the relationship is persistent, then objects that are added to the relationship are automatically made persistent. However, I can not get this to work the other way around. I would also like the relationship owner to be persisted if a persisted object is added on the owner side. I have included a minimal example: ... cascade = { PERSIST , REFRESH , MERGE } ) private Set<Point> points = new ... , cascade = { PERSIST , REFRESH , MERGE } ) private Set<PointCollection> ...

 
release

2.3.2

... bugs in using flush. Fixed bugs in cascading merge. Fixed a multithreading deadlock bug . ...

 
forum_thread

Removing an element from an @OneToMany doesn't work

Hello. I have a Parent and Child entities. // in the parent @OneToMany(mappedBy = "parent", fetch = FetchType.EAGER, cascade = CascadeType.ALL) private List<Child> children; // in the child @ManyToOne private Parent parent; Somewhere I do this: parent.getChildren().remove(0); manager.merge(parent); Manager.merge is just ... ) . remove ( 0 ) ; manager. merge ( parent ) ; Manager.merge is just transaction. begin ( ) ; entityManager. merge ( o ) ; transaction. commit ( ) ; ...

 
release

2.2.1

Release date: 2011-04-10 Download (5.07 MB) Binary:  objectdb-2.2.1.zip You should start by following a  tutorial or reading the manual ...

 
forum_thread

Java 8 Enhancer Problem

Hello! I am currently migrating my project to Java 8. I'm using Spring and AspectJ load time weaving. Unluckily the LTW option of Spring is global. If it's enabled it also tries to find other class transformers on the classpath. This is normaly not a problem because the ObjectDB enhancer ignores non @Entity or already enhanced classes but in conjunction with new Java 8 class files it throws an exception which causes Spring to stop weaving.  ... but it has a new bug. When I fetch, detach, change and merge an object I get the following exception: Caused by: ... com.objectdb.jpa.EMImpl.merge(EMImpl.java:518) Inserting new objects works. Also merging ones ...

 
forum_thread

Upgrade to 2.4.1_02

Hi there, The upgrade to 2.4.1_02 fixed the initial problem, however there still seems to be an issue. To me it appears that Embeddable might be being lazy loaded, but I cannot be sure. I have attached a testcase demonstrating this issue. Its failing on the merge. Thanks P. ... a testcase demonstrating this issue. Its failing on the merge. Thanks P. ... reflection (error 363) at com.objectdb.jpa.EMImpl.merge(EMImpl.java:454) at ... at com.objectdb.jpa.EMImpl.merge(EMImpl.java:451) ... 24 more Caused by: ...

 
issue

After using the enhancer, Lazy loaded collections are no longer loading. They are set as null

Environment: Mac OS X JVM: Java 1.8 u 20 Steps to reproduce Use the following classes: /** Account Class **/ ... ( cascade = { CascadeType . MERGE , CascadeType . PERSIST } , mappedBy = ... ( cascade = { CascadeType . MERGE , CascadeType . PERSIST } , mappedBy = ...

 
release

2.2.0

Release date: 2011-04-03 Download (3.99 MB) Binary:  objectdb-2.2.0.zip You should start by following a  tutorial or reading the manual ...

 
issue

Unexpected exception (Error 990) - NullPointerException

I'm using Version 2.5.4_05 Maybe this Exception is created by calling em.merge()  - et least this is what I do in the named line. ... Maybe this Exception is created by calling em.merge()  - et least this is what I do in the named line. [ObjectDB ... com.objectdb.jpa.EMImpl.merge(EMImpl.java:514) at ... ... It indicates an unexpected problem during a merge operation, when an object for merge has an unexpected type. Could ...

 
release

2.2.2

Release date: 2011-04-22 Download (5.07 MB) Binary:  objectdb-2.2.2.zip You should start by following a  tutorial or reading the manual ...