I'm using hibernate to store a set of objects from a web service.
As the object are received each I am saving them using hibernate.
Receiving the objects is wrapped in a transaction and all the objects appear in the database after the final object is received.
I am now trying have each object appear in the database when saved. I've tried to achieve this with
getHibernateTemplate().saveOrUpdate( foo );
getHibernateTemplate().flush();
getHibernateTemplate().clear();
My understanding is this should remove the values hibernate's cache and write the values to the database.
Any learning or directions?