I am trying to track down some obscure errors with multi-threading. This involved looking at the EntityManager Metamodel but this caused an ObjectDB exception. So I reverted to your example code in the tutorial (with class Point) and it works as expected:
: (995, 995) (996, 996) (997, 997) (998, 998) (999, 999)
If I then add one line of code to your example code:
: // Store 1000 Point objects in the database: em.getTransaction().begin(); for (int i = 0; i < 1000; i++) { Point p = new Point(i, i); em.persist(p); } em.getTransaction().commit(); // ADD THIS ONE LINE... em.getMetamodel().getEntities().forEach( (e)->System.out.println(" EntityType: " +e.getName())); :
ObjectDB returns with:
Exception in thread "main" com.objectdb.o.UserException: Too many persistable types (>10) - exceeds evaluation limit at com.objectdb.o.MSG.a(MSG.java:64) at com.objectdb.o.MST.Zj(MST.java:1145) at com.objectdb.o.WRA.Zj(WRA.java:215) at com.objectdb.o.STC.g(STC.java:341) at com.objectdb.o.SHN.H(SHN.java:389) at com.objectdb.o.SHN.w(SHN.java:134) at com.objectdb.o.HND.run(HND.java:134) at java.lang.Thread.run(Thread.java:748)
Explorer still shows just the one type. The log file shows the same stack trace and nothing else of note.