368 words

Failing to read entities under load in multithreaded tests

#1
2012-03-17 08:11

Hi,

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:

@Entity
@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
@TableGenerator(name="TestIdTableGen", initialValue=0, allocationSize=50)
public class TestIdHolder implements Serializable{
    private static final long serialVersionUID = 1L;
 
    private long version;
 
    private long longId;
 
    @Id
    @GeneratedValue(strategy=GenerationType.TABLE, generator="TestIdTableGen")
    public long getLongId() {
        return longId;
    }
 
    public void setLongId(long longId) {
        this.longId = longId;
    }
 
    @Version
    public long getVersion() {
        return version;
    }
}
 
@Entity
@Indices({
@Index(members={"oidId", "type"}),
    @Index(members={"parentAcl"})
})
public class TestEntity extends TestIdHolder {
    private static final long serialVersionUID = 6249921651146397564L;
 
    @OneToOne(cascade=CascadeType.REFRESH, fetch=FetchType.EAGER)
    private TestEntity parentAcl;
    @Basic
    private boolean entriesInheriting = true;
 
    private long oidId;
 
    private String type;
 
  ............................

Kind regards,

Natalia Levine.

 

natmaclin
natmaclin's picture
Joined on 2011-11-04
User Post #21
#2
2012-03-17 22:57

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)
support
support's picture
Joined on 2010-05-03
User Post #980
#3
2012-03-19 00:50

Hi, 

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.

Regards,

Natalia.

natmaclin
natmaclin's picture
Joined on 2011-11-04
User Post #22
#4
2012-03-19 02:01

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
com.objectdb.o.InternalException
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)

Regards,

Natalia.

natmaclin
natmaclin's picture
Joined on 2011-11-04
User Post #23
#5
2012-03-19 06:43

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)
support
support's picture
Joined on 2010-05-03
User Post #983
#6
2012-03-19 23:20

Hi,

This last build has fixed the issue,

Thanks,

Natalia.

natmaclin
natmaclin's picture
Joined on 2011-11-04
User Post #24

Post Reply

Please read carefully the posting instructions - before posting to the ObjectDB website.

  • You may have to disable pop up blocking in order to use the toolbar (e.g. in Chrome).
  • Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell checker).
  • To insert formatted lines (e.g. Java code, stack trace) - select a style in the toolbar and then insert the text in the new created block.
  • Avoid overflow of published source code examples by breaking long lines.
  • You may mark in paragraph code words (e.g. class names) with the code style (can be applied by ctrl + D).
  • Long stack traces (> 50 lines) and complex source examples (> 100 lines) should be posted as attachments.
Attachments:
Maximum file size: 32 MB
Cancel