关于Hibernate批量处理!
需要用hibernate批量进行保存操作,代码如下,其中list里可能会有30W条数据左右,目前已经跑12个小时(weblogic 920),大家讨论下看有没有更好的方法,或者代码方面,配置方面需要更改的!
另外,暂时不考虑通过jdbc,或者存储过程来实现!
另外,暂时不考虑通过jdbc,或者存储过程来实现!
public List<FeePayStream> newSaveFeePayStream(List<FeePayStream> list) throws FeePayManageDaoException {
Session session = this.getSession();
int i=0;
try {
for (FeePayStream feePayStream : list) {
session.save(feePayStream);
i++;
if(i%50==0)
{
session.flush();
session.clear();
}
}
}
catch (Exception e) {
throw new FeePayManageDaoException(e.getMessage());
}
finally {
session.flush();
session.clear();
}
return list;
}
...全文


