Page 1 of 1

create session per request and session per thread.

PostPosted: Wed Jul 11, 2018 5:57 am
by spadekevin
Hello,

I am using Hibernate in my application and now currently i am using Session per operation anti-pattern.

I have several threads in my application which gets created time to time and load new rows in to database. While the threads are working, i have another pages that should read the same data, I can not create same session for the threads and the user requested pages, so i get two different disjoint places where i get to read the same data, one place where data is loaded and another place where i need to read the same data, so how should i modify my anti-pattern design to another design where i can create session per request and session per thread.

Please help.

I didn't find the right solution from the internet.

References:
https://forum.hibernate.org/viewtopic.p ... &view=next
Real Estate Video marketing

Thank you