Home » Support » Forum » Failing to read entities under load in multithreaded tests

Failing to read entities under load in multithreaded tests



We are experiencing an issue in our application that only occurs under load - we sometimes fail to read entities from the database.

I've isolated this issue to a fairly simple test case (please see attached eclipse project). I have some test entities listed below. When I run a load test that creates, reads and updates these entities in multithreaded application it sometimes fails to read them from the DB with "No matching results for a unique query" error. The error occurs in 2-3% of iterations. When I run the same test in a single thread it is 100% successful.

I'm using version 2.3.7.

Test entities:

@TableGenerator(name="TestIdTableGen", initialValue=0, allocationSize=50)
public class TestIdHolder implements Serializable{
    private static final long serialVersionUID = 1L;

    private long version;

    private long longId;

    @GeneratedValue(strategy=GenerationType.TABLE, generator="TestIdTableGen")
    public long getLongId() {
        return longId;

    public void setLongId(long longId) {
        this.longId = longId;

    public long getVersion() {
        return version;

@Index(members={"oidId", "type"}),
public class TestEntity extends TestIdHolder {
    private static final long serialVersionUID = 6249921651146397564L;
    @OneToOne(cascade=CascadeType.REFRESH, fetch=FetchType.EAGER)
    private TestEntity parentAcl;
    private boolean entriesInheriting = true;
    private long oidId;
    private String type;


Kind regards,

Natalia Levine.



Thank you for this report and for the useful test case.

Please try build 2.3.7_06 that should fix this issue.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)


Thanks for the fix. It is working much better now, but unfortunately it is still not 100% - if I run the same test with 20 threads and 1000 iterations I still get 1 or 2 failures.




I've also just noticed that the error is different now - I get this exception:

[ObjectDB 2.3.7] Unexpected exception (Error 990)
  Generated by Java HotSpot(TM) 64-Bit Server VM 1.6.0_27 (on Windows 7 6.1).
Please report this error on http://www.objectdb.com/database/issue/new
com.objectdb.o.InternalException: null
at com.objectdb.o.PRG.ag(PRG.java:611)
at com.objectdb.o.PRG.af(PRG.java:553)
at com.objectdb.o.QRM.U5(QRM.java:262)
at com.objectdb.o.MST.U5(MST.java:947)
at com.objectdb.o.WRA.U5(WRA.java:290)
at com.objectdb.o.WSM.U5(WSM.java:113)
at com.objectdb.o.STC.r(STC.java:447)
at com.objectdb.o.SHN.aj(SHN.java:489)
at com.objectdb.o.SHN.K(SHN.java:156)
at com.objectdb.o.HND.run(HND.java:133)
at java.lang.Thread.run(Unknown Source)




It indicates that the fix was incomplete. Please try build 2.3.7_07.

If you still see the problem, please specify the parameters that you were using for running the test.

In addition, the stack trace above indicates using previous build  (2.3.7) at least on the client side. Make sure you are using the same ObjectDB build for both the client and the server.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)


This last build has fixed the issue,



Post Reply

To post a reply and/or subscribe to update notifications - please login