我很难弄清楚我该怎么处理这个问题。我想做这样的事情:
child.merge(object);
parent1.setCdate(new Date());
parent1.merge(child.parent);
parent2.setCdate(new TimeStamp(new Date().getTime()));
parent2.merge(parent1.parent);
但是我在更新 parent2 时遇到错误。基于我在网上研究的内容, 我认为这是造成错误的原因。
@Version
@Column(name = "CDATE")
private Timestamp cdate;
这就是错误所说的:
The object [ph.gov.bsp.tcms.core.Document[ refno=2016052002 ]] cannot be updated because it has changed or been deleted since it was last read.
你能帮我解决这个问题。谢谢!