修改事务问题

This commit is contained in:
tangft 2021-06-10 17:31:40 +08:00
parent ca8b4b4487
commit 0bcf64c31c
2 changed files with 11 additions and 3 deletions

View File

@ -364,7 +364,7 @@ public class RentCalHelper {
}
public String rentPlanDate(){
JBOTransaction tx;
JBOTransaction tx = null;
try {
tx = JBOFactory.createJBOTransaction();
String sql = "SELECT CASE WHEN COUNT(*) > 0 THEN MAX(PLAN_DATE) ELSE 'null' END date FROM lc_rent_plan WHERE DATE_FORMAT(PLAN_DATE, '%Y/%m/%d') <= DATE_FORMAT('"+this.paydayAdjust+"', '%Y/%m/%d') AND contract_id =?";
@ -380,6 +380,14 @@ public class RentCalHelper {
}
} catch (Exception e) {
e.printStackTrace();
}finally {
try {
if(tx !=null) {
tx.commit();
}
} catch (JBOException e) {
e.printStackTrace();
}
}
return "error";

View File

@ -14,9 +14,9 @@ public class CheckGuaranteeUnit {
private String flowunid;
private int number;
public String CheckGuaranteeUnitCount(JBOTransaction tx) throws SQLException{
public String CheckGuaranteeUnitCount(JBOTransaction tx) throws Exception{
Transaction Sqlca =null;
Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource());
Sqlca = Transaction.createTransaction(tx);
String sql="select count(1) as count from LB_GUARANTEE_UNIT_TEMP where FLOWUNID=:flowunid";
SqlObject asql = new SqlObject(sql);
asql.setParameter("flowunid", this.flowunid);