I\'m using hibernate + play! framework at work, is there a \"best practice\" on inserting a good amount of records using hibernate? They are around 6,000 to 10,000 per text
From *Java Persistence and Hibernate" (Manning) and following a comment from Pangea, use a stateless session (which doesn't have a persistence context cache) :
StatelessSession session = sessionFactory.openStatelessSession();
Transaction tx = session.beginTransaction();
for ( int i=0; i<100000; i++ ) {
Item item = new Item(...);
session.insert(item);
}
tx.commit();
session.close();