You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Scala 2.9 REPL evaluates each line in its own thread.
This violates the principle of least astonishment, but more importantly, it makes the REPL unusable with the many libraries that rely on thread-local contexts.
For instance, many ORMs use thread-locals for session management. One cannot meaningfully use these ORMs from the REPL as a result.
The text was updated successfully, but these errors were encountered:
Christian Schlichtherle (christian_schlichtherle) said:
This just puzzled me, too:
Welcome to Scala version 2.9.2 (JavaHotSpot(TM) ClientVM, Java1.7.0_05).
Type in expressions to have them evaluated.
Type:help for more information.
scala>valtl=newThreadLocal[Int]
tl: java.lang.ThreadLocal[Int] = java.lang.ThreadLocal@3571fd
scala> tl.set(1)
scala> tl.get
res1:Int=0
The Scala 2.9 REPL evaluates each line in its own thread.
This violates the principle of least astonishment, but more importantly, it makes the REPL unusable with the many libraries that rely on thread-local contexts.
For instance, many ORMs use thread-locals for session management. One cannot meaningfully use these ORMs from the REPL as a result.
The text was updated successfully, but these errors were encountered: