I am trying to save my data in MySql (local DB) by dragging and dropping HibernateTemplate -
getHibernateTemplate().execute(new HibernateCallback<Void>() {
@Override
public Void doInHibernate(Session session) throws HibernateException, SQLException {
for (TimeInvocationStatistics stat : statistics) {
session.persist(stat);
}
session.persist(workloadProcessDescriptiveStatistics);
session.flush();
return null;
}
});
The data size is small, but this operation takes more than 60 seconds.
I tried to project it -

(good image resolution - picture )
As I see, session.flush () (second line in stacktrace) is slow, how can I improve it? Could there be problems with the MySql server?
UPD: find an interesting topic - hibernate forum , try to do it
source
share