mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-12 22:41:35 +00:00
#2377 - Wrong order in batch save, fix transaction depth
The guts of this fix is in DefaultPersister.saveAssocOne() with the change to use the new transaction.depthDecrement() method. For our failing test cases this changes the depth from -1, 0 to be 0, 1. We can see the impact of this change in the batch ordering via the logging of: io.ebean.SUM - txn[1001] BatchControl flush ...
This commit is contained in:
1 parent
b38a21f8c4
commit
f51f2269fb
10 files changed
+134
-59
No files matched your search
@@ -1,12 +1,14 @@
|
||||
package org.tests.model.basic.relates;
|
||||
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
import io.ebean.annotation.ChangeLog;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.ManyToOne;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Relation entity
|
||||
*/
|
||||
@@ -23,6 +25,9 @@ public class Relation2 {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@ManyToOne
|
||||
private Relation4 r4NoCascade;
|
||||
|
||||
@ManyToOne
|
||||
private Relation3 noCascade;
|
||||
|
||||
@@ -60,5 +65,12 @@ public class Relation2 {
|
||||
public void setWithCascade(Relation3 withCascade) {
|
||||
this.withCascade = withCascade;
|
||||
}
|
||||
|
||||
|
||||
public Relation4 getR4NoCascade() {
|
||||
return r4NoCascade;
|
||||
}
|
||||
|
||||
public void setR4NoCascade(Relation4 r4NoCascade) {
|
||||
this.r4NoCascade = r4NoCascade;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package org.tests.model.basic.relates;
|
||||
|
||||
|
||||
import io.ebean.annotation.ChangeLog;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Relation entity
|
||||
*/
|
||||
@Entity
|
||||
@ChangeLog
|
||||
public class Relation4 {
|
||||
|
||||
@Id
|
||||
private UUID id = UUID.randomUUID();
|
||||
|
||||
private String name;
|
||||
|
||||
public Relation4(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user