CDillinger wrote:
How much work is being done within each session? Is it possible that you work with only one very large session? This session "holds" all entities being read which slows down everything that has to be done with all the entities the session holds (e.g. dirty checking). You could try session.flush() and session.clear() at certain points to get rid of entities that you don't need anymore. And you should use a session only as long as you need it.
The sessions are only being used for a single request, typically around 200-500ms. We currently even do a flush() and clear() before we close the session in order to avoid anything related with c3p0 session pooling.
But I noticed one more thing: Beside all other persistence related things getting slower the Transaction.commit() gets remarkably slower. From around 25ms up to 150-250ms for the same operation.
Any clue? Thanks!