在我的本地系统中,它解决了任何问题。我的本地系统是Windows 7,但在生产服务器(Linux)中随机出现异常。 我正在分享代码请指导我。这个异常只是在同一个地方出现的原因。
saveOrUpdate方法发生异常
billSubmissionBean.setMasterProviderId(String.valueOf(masterProvider.getMasterProviderId()));
masterBill.setMasterProvider(masterProvider);
masterBill.setTransactionType(transactionType);
billSubmissionDao.save(masterBill, MasterBill.class);
BillSubmission billSubmission = getBillSubmissionFromBean(billSubmissionBean, user);
billSubmission.setMasterBill(masterBill);
billSubmission.setBillSubmissionNumber(masterBill.getBillSubmissionNumber());
billSubmission.setMasterProviderId(masterProvider.getMasterProviderId());
billSubmission.setTransactionType(transactionType);
billSubmission.setApiFlg(Boolean.TRUE);
if(StringUtils.strToBoolean(billSubmissionBean.getGenerateBillDocument())) {
billSubmission.setBillDocumentFlg(Boolean.TRUE);
}
billSubmissionDao.save(billSubmission, BillSubmission.class);
List<BillingServiceBean> billingServicesList = billSubmissionBean.getServices();
if(billingServicesList != null) {
List<BillService> billServicesList = new ArrayList<BillService>();
for (BillingServiceBean billServiceBean : billingServicesList) {
BillService billService = getBillServiceFromBillServiceBean(billServiceBean, user, billSubmissionBean.getGenerateBillDocument());
billService.setBillSubmission(billSubmission);
billServicesList.add(billService);
}
log.info("Bill services size : " + billServicesList.size());
if(billingServicesList.size() > 0) {
billSubmissionDao.saveOrUpdateAll(billServicesList);//this location
}
}
excption:
org.springframework.jdbc.UncategorizedSQLException:Hibernate 刷新:无法插入:[gov.nysif.model.BillService]; 未分类SQL的SQLException [插入nysif.bill_service (bill_submission_id,service_place,service_procedure, service_modifiers,dx_pointer,service_days,billed_amount, service_ndc,service_ndc_qty,anesthesia_start,anesthesia_end, revenue_code,dos_from_dt,dos_to_dt,created_dt,created_user, modified_dt,modified_user,non_covered_charges,bill_service_id) 值(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)]; SQL状态[55000];错误代码[0];本声明已经结束。 嵌套异常是org.postgresql.util.PSQLException:这个语句 已被关闭。在 org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) 在 org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) 在 org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) 在 org.springframework.orm.hibernate3.HibernateTransactionManager.convertJdbcAccessException(HibernateTransactionManager.java:726)