Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session object inside a java method

 
suraj august
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Local variables are thread safe in java .Then how come we get Session object using Session s=SessionFactory.opensession() inside a method is not thread safe ?
 
Paul Clapham
Sheriff
Posts: 21579
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
suraj aryan wrote:Local variables are thread safe in java.


Who told you that? Have a look at this thread: http://www.coderanch.com/t/233488/threads/java/Local-variables-thread-safe for a more detailed discussion of your question.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic