int result = ((List) query.execute()).size();
tx2.commit();
assertEquals("Wrong number of objects wrote to DB", loops, result);
PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker();
broker.clearCache();
Criteria crit = new Criteria();
crit.addLike("articleName", PRE + "testLockLoop");
result = broker.getCount(QueryFactory.newQuery(Article.class, crit));
broker.close();
assertEquals("Wrong number of objects wrote to DB", loops, result);