Aleksei Kachanov
08-02-2006, 12:17 PM
java
/**
* This Map needs to be synchronized because there might be multi-threaded
* access in the case of JTA with remote transaction propagation.
*/
private final Map sessionMap = Collections.synchronizedMap(new HashMap(1));
C#
private static readonly Hashtable sessionDictionary
= System.Collections.Hashtable.Synchronized(new Hashtable(1));
by static keyword sessionDictionary is shared between diffent threads as result different instances of SessionHolder always contains the same collection with session
This problem occured when you try integrate OpenSessionInView module and use single session per request
/**
* This Map needs to be synchronized because there might be multi-threaded
* access in the case of JTA with remote transaction propagation.
*/
private final Map sessionMap = Collections.synchronizedMap(new HashMap(1));
C#
private static readonly Hashtable sessionDictionary
= System.Collections.Hashtable.Synchronized(new Hashtable(1));
by static keyword sessionDictionary is shared between diffent threads as result different instances of SessionHolder always contains the same collection with session
This problem occured when you try integrate OpenSessionInView module and use single session per request