摘要:
http://blog.csdn.net/shendl/article/details/1415958 阅读全文
摘要:
1 Session session = sessionFactory.openSession(); 2 Transaction tx = session.beginTransaction(); 3 for ( int i=0; i<100000; i++ ) { 4 Customer customer = new Customer(.....); 5 session.save(customer); 6 if ( i % 20 == 0 ) { //20, same as the JDBC batch size 7 //flush a batch of inserts and releas 阅读全文