himawan wrote:
Well the code didn't help as much as I hoped it would. The main thing I was hoping to see was how the session is managed.
It seems like it's managed by Spring?
sorry about this, yeah it's managed by Spring,
himawan wrote:
Does manager.auditEvent() do anything to inboundProfile?
Here's the code for auditEvent(), it didn't touch the inboundProfile, it just copy its state to inProfileHistory.
Code:
try {
auditDao.save(auditMessage);
if (auditMessage.getTableName() == AuditableData.INBOUND_PROFILE) {
InboundProfileHistory inProfileHistory = new InboundProfileHistory();
entity.copyToHistory(inProfileHistory); [b]// copy state[/b]
inProfileHistory.setInboundProfile((InboundProfile) entity);
inProfileHistoryDao.save(inProfileHistory);
}
} catch (DataAccessException e) {
throw new AuditException(e.getMessage());
}
From the source code I post before this, it seems like the hibernate wasn't able to perform autoFlush...(), when it executes the remove() method on the inboundProfile.
I've already tried to put out primary key and the version field from the @MappedSuperClass, instead I put those two fields in the persistent subclasses @Entity, but to no avail, the test case still fails.
Anything more you need to figure this out??