I was working on reporting service for my application and found a problem with datasets bigger than treshold set in objectdb.conf.
<objectdb> <general> <temp path="$temp/ObjectDB" threshold="64mb" /> <network inactivity-timeout="0" /> <log path="$objectdb/log/" max="8mb" stdout="false" stderr="false" /> <log-archive path="$objectdb/log/archive/" retain="90" /> <logger name="query.manager" level="debug" / </general>
with these settings, running a query that operates on quite a big number of objects (~300k) throws an exception:
com.objectdb.o.UserException: Failed to create a new file '/tmp/ObjectDB/789641482/BatchQueryItr_0.fls' at com.objectdb.o.MSG.d(MSG.java:74) ~[objectdb.jar:na] at com.objectdb.o.LFL.K(LFL.java:826) ~[objectdb.jar:na] at com.objectdb.o.LFL.H(LFL.java:766) ~[objectdb.jar:na] at com.objectdb.o.TFM$h.H(TFM.java:190) ~[objectdb.jar:na] at com.objectdb.o.LFL.H(LFL.java:735) ~[objectdb.jar:na] at com.objectdb.o.VLV.o(VLV.java:224) ~[objectdb.jar:na] at com.objectdb.o.VLV.m(VLV.java:166) ~[objectdb.jar:na] at com.objectdb.o.TAI.N(TAI.java:271) ~[objectdb.jar:na] at com.objectdb.o.TAI.j(TAI.java:234) ~[objectdb.jar:na] at com.objectdb.o.RTT.F(RTT.java:263) ~[objectdb.jar:na] at com.objectdb.o.RTT.E(RTT.java:245) ~[objectdb.jar:na] at com.objectdb.o.RST.B(RST.java:169) ~[objectdb.jar:na] at com.objectdb.o.RTT.l(RTT.java:134) ~[objectdb.jar:na] at com.objectdb.o.RST.l(RST.java:24) ~[objectdb.jar:na] at com.objectdb.o.RTT.C(RTT.java:179) ~[objectdb.jar:na] at com.objectdb.o.RST.r(RST.java:110) ~[objectdb.jar:na] at com.objectdb.o.PGT.q(PGT.java:109) ~[objectdb.jar:na] at com.objectdb.o.RST.A(RST.java:93) ~[objectdb.jar:na] at com.objectdb.o.RTT.l(RTT.java:132) ~[objectdb.jar:na] at com.objectdb.o.RST.l(RST.java:24) ~[objectdb.jar:na] at com.objectdb.o.RTT.C(RTT.java:179) ~[objectdb.jar:na] at com.objectdb.o.RST.r(RST.java:110) ~[objectdb.jar:na] at com.objectdb.o.PGT.q(PGT.java:109) ~[objectdb.jar:na] at com.objectdb.o.RST.A(RST.java:93) ~[objectdb.jar:na] at com.objectdb.o.RTT.l(RTT.java:132) ~[objectdb.jar:na] at com.objectdb.o.RST.l(RST.java:24) ~[objectdb.jar:na] at com.objectdb.o.TSK.i(TSK.java:146) ~[objectdb.jar:na] at com.objectdb.o.TSK.f(TSK.java:95) ~[objectdb.jar:na] at com.objectdb.o.TSM.e(TSM.java:87) ~[objectdb.jar:na] at com.objectdb.o.MST.UP(MST.java:545) ~[objectdb.jar:na] at com.objectdb.o.PLN.UP(PLN.java:481) ~[objectdb.jar:na] at com.objectdb.o.TAI.M(TAI.java:200) ~[objectdb.jar:na] at com.objectdb.o.TAI.Us(TAI.java:134) ~[objectdb.jar:na] at com.objectdb.o.MQI.Us(MQI.java:96) ~[objectdb.jar:na] at com.objectdb.o.PRG.aa(PRG.java:596) ~[objectdb.jar:na] at com.objectdb.o.QRM.UR(QRM.java:256) ~[objectdb.jar:na] at com.objectdb.o.MST.UR(MST.java:878) ~[objectdb.jar:na] at com.objectdb.o.WRA.UR(WRA.java:286) ~[objectdb.jar:na] at com.objectdb.o.WSM.UR(WSM.java:113) ~[objectdb.jar:na] at com.objectdb.o.STC.r(STC.java:421) ~[objectdb.jar:na] at com.objectdb.o.SHN.ah(SHN.java:468) ~[objectdb.jar:na] at com.objectdb.o.SHN.J(SHN.java:146) ~[objectdb.jar:na] at com.objectdb.o.HND.run(HND.java:133) ~[objectdb.jar:na] at java.lang.Thread.run(Thread.java:636) [na:1.6.0_24] Caused by: java.io.FileNotFoundException: /tmp/ObjectDB/789641482/BatchQueryItr_0.fls (No such file or directory) at java.io.RandomAccessFile.open(Native Method) ~[na:1.6.0_24] at java.io.RandomAccessFile.<init>(RandomAccessFile.java:233) ~[na:1.6.0_24] at com.objectdb.o.LFL.K(LFL.java:813) ~[objectdb.jar:na] ... 42 common frames omitted
Changing treshold to 96M "fixes" the problem - with 96MB can run this query in memory, so no temp files.
Doctor works fine with low treshold values and can create files in tmp for each run if needed.