• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hibernate session in a thread

 
sam bartl
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my application I call new Thread() to run parallel executions , and this thread needs hibernate session , I am doing this to open and close session please advice me if this is righrt
her as an example




this is class I wrote to open session bind it to thread



this class uses the util to open session and close. Please advice me if this is right ?

I know about hibernateInterceptor but I cannot use this as CustomScriplet class is not managed by spring.
Please advice me how to open and close session .
 
sam bartl
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please gurus tell me how to get hibernate session when I want to do parallel processing using threads , Mine is web application , I hvae open view session filter , for every request a session is crested set in thread I understand that , but in my case in my servlet I am starting three new threads and all these threads needs hibernate session ofocurse the session from open view session filter cannot be accessed in these threads , please advice em how to create and bind the threads in this case, help is very much appreciated.
 
sam bartl
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gurus please help is my question not clear?please I need help
 
Prabaharan Gopalan
Ranch Hand
Posts: 66
Java Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Q 1: Did it work? (IOW, are you looking for better ways to do this?)
Q 2: It doesn't work - and you want us to find out what's wrong?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic