Properties properties = new Properties(); UserTransactionManager utm = new UserTransactionManager(); utm.init(properties); int batchSize = 100; int totalRecords = 10000; try { UserTransaction ut = new UserTransactionImp(); ut.begin(); for (int i = 1; i <= totalRecords; i++) { // ... if (i % batchSize == 0) { ut.commit(); ut.begin(); } } ut.commit(); } catch (Exception e) { // ... }


上一篇:
下一篇:
切换中文