Dear all,
How to make persistent POJO as detached one without close the session?
according to this article -
Generic Data Access Objects, is it possible to add another method
Code:
void makeDetached(T entity);
or more intuitive one:
Code:
T findById(ID id, boolean detached);
with internal implementation that keeping the session opening?
I need some object to be detached, but some others to be persistented, but all of them derived from the same session of the current thread, can anybody give me some suggestions? I think open/close session too frequently is not a good design decision and impractical..