update更新提交后数据库未发生变化,代码如下:
NutTxDao tx = new NutTxDao(daoTemplate.getDataSource());
try {
// 事务开启
tx.beginRC();
for (Map.Entry<String, Object> entry : queMap.entrySet()) {
String tabname = entry.getKey();
List<?> tablist = (ArrayList) entry.getValue();
if(tablist.size()!=0){
for (Object tabobj : tablist) {
Map<String, Object> inmap = (Map<String, Object>) tabobj;
inmap.put(".table", tabname);
cureMap.put("tabname", tabname);
Map parmMap = this.getTabMess(cureMap, tx);
if ((Boolean) parmMap.get("flag")) {
inmap.putAll((Map)parmMap.get("parm")); // 插入时带入主键
tx.insert(inmap);
} else {
tx.update(inmap,Cnd.where((String)parmMap.get("cond"),"=",cureMap.get(parmMap.get("cond"))));
// 这个地方我更新后提交完数据库不变
}
}
}
}
tx.commit();