jccanova wrote:
My sugestion if instead you use the threadlocal object... which leads the code to be hard to read... you store your shared objects on ConcurrentHashMap for example(depending the number of users of your app you even notice any performance issue)... check this class implementation...
ThreadLocal pattern. is recommended to use with 'context' - 'configuration' like objects... (check jbpm implementation of configuration and context object.). Also if you configure your session (current_session_context_class) to thread hibernate will use the threadlocal to store it... is that assumption correct ?
regards.
Not sure what you mean by 'contex' but if i set this parameter
Code:
<property name="current_session_context_class">thread</property>
from hibernate.cfg.xml file, does that mean i should now use the ServletFilter to get the currentSession on threadLocal?