I have this problem that my session.flush() or transaction.commit() are getting slower and slower, the app races through the 1st 500k rows at about 15Mbit than it slows to a cralw below 1Mbit and stalling, when I comment out the session flushing and commiting than the performance of read is constant, why would the commit take progresively more time
when I skip the 1st 1000000 rows, the performance over the 1st 50-100k rows is good but than falls of a cliff, what is wrong with session commit ?
Code:
h.setItems(itms);
if (!onlyTest) {
session.persist(h); // < ----------------- save this object in a batch
}
}
// session.flush()
tx.commit();
} catch (final Exception ex) {
tx.rollback();
logger.error(ex.getMessage());
} finally {
if (session != null && session.isConnected()) {
session.clear();
session.close();
}
}