anthony wrote:
ok now are you re attaching the object using session.update or session.lock?
session.update(...)
protected void checkConnected() {
if (session == null || !session.isOpen()) {
reconnect();
}
}
protected void reconnect() {
this.session = sessionService.getSession(target.getClass(),SessionOptions.MANAGED);
try {
this.session.update(target);
} catch (HibernateException e) {
throw new BasicRuntimeException("CANT_RECONNECT_ENTITY", e,
new Object[] { this, target });
}
}
the interceptor
builder.addln("checkConnected();");
boolean notVoid = !methodSignature.getReturnType().equals(
void.class);
builder.addln((notVoid ? "return ($r)" : "($r)") + " (("
+ entityClass.getName() + ") target).{0}($$);",
methodSignature.getName());