We're using the following to trigger an online backup and we're trying to implement server-side online backup (as discussed in https://www.objectdb.com/forum/2737).
EntityManager em = database.createEntityManager(); TypedQuery<Thread> backupQuery = em.createQuery("objectdb backup", Thread.class); backupQuery.setParameter("target", "relative-path"); backupQuery.setParameter("name", backupSubdir);
In case the relative-path is not writable we've get:
com.objectdb.o.UserException: Failed to create a new file '/absolute-path/relative-path/database.odb' at com.objectdb.o.MSG.a(MSG.java:77) at com.objectdb.o.LFL.m(LFL.java:870) at com.objectdb.o.LFL.x(LFL.java:810) at com.objectdb.o.LFL.x(LFL.java:779) at com.objectdb.o.LFL.ZW(LFL.java:518) at com.objectdb.o.BAC.f(BAC.java:121) at com.objectdb.o.TOL.run(TOL.java:117) at com.objectdb.o.DTT.run(DTT.java:77) at com.objectdb.o.STD.run(STD.java:75) Caused by: java.io.FileNotFoundException: /absolute-path/relative-path/database.odb (No such file or directory) at java.base/java.io.RandomAccessFile.open0(Native Method) at java.base/java.io.RandomAccessFile.open(RandomAccessFile.java:344) at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:259) at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:213) at com.objectdb.o.LFL.m(LFL.java:857) ... 7 more
But we can't handle it anyway. We would need to be able to report this error via our reporting tool.