Jira's have been entered regarding the current solution to detached entity coillections.
Regardless...
This appears to be the accurate solution.
HibernatePersistenceServiceImpl.JAVA
@Transactional
public void reattach(Object model)
{
try {
getSession().lock(model, LockMode.
NONE);
}
catch (org.hibernate.NonUniqueObjectException ex) {
merge(model);
}
}
ManyToOne annotation should at least be operated as follows:
@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE } )
OneToMany annotation seems ok as follows:
@OneToMany(cascade=CascadeType.ALL)
These seem to mitigate LazyInitializationExceptions, NonUniqueObjectExceptions and deletion of parent delegates via misuse of
CascadeType.ALL which will rampantly travel up the object graph and delete entities not intended to be deleted.
Best regards
Ken in nashua
Shed those extra pounds with MSN and The Biggest Loser!
Learn more.
Best regards
Ken in nashua