Hardware configuration:
4G memory, CPUi3-2.3
Database sql2008
Package COM. pan. test; import Org. hibernate. session; import Org. hibernate. transaction; import COM. pan. bean. student; import COM. pan. uitl. hibernatesessionfactory; public class test {/*** @ Param ARGs */public static void main (string [] ARGs) {// todo auto-generated method stubopen ();} private Static void open () {// 100 pieces of data: 521-689 // 1000 pieces of data: 8193 // After the task is divided into 10 threads: 6997-6698 // 100 threads: Each thread has 10 tasks-2798 // 100 threads to test each 10 tasks 6701 records/10000 data records 63899 CPU around 22%-94876 // 95361 threads 10 tasks 1000 records/71344 data points task Testing // 1000 tasks are divided into 10 task sessions = hibernatesessionfactory. getsession (); long starttime = system. currenttimemillis (); For (INT I = 0; I <1000; I ++) {thread th = new mythread (session, 100); th. setpriority (thread. max_priority); th. run ();} Long endtime = system. currenttimemillis (); Session. close (); system. out. println (endtime-starttime) ;}} class mythread extends thread {private session; private int size; Public mythread (session, int size) {This. session = session; this. size = size ;}@ overridepublic void run () {for (INT I = 0; I <size; I ++) {transaction = session. begintransaction (); Student = new student (); student. setaddress ("after the TV series payment, the tower will be shipped to island coffee or client as soon as possible"); student. setmsn ("pan@baletu.com"); student. setname ("James"); student. setnickname ("James"); student. setphone ("15159665635"); student. setqq ("599194993"); student. setremark. save (student); transaction. commit ();} session. flush ();}}