Hi,
I have got a basic few questions regarding Hibernate in J2EE servers. Please help me in clearing my doubts.
a) As per EJB specs. IO and Reflections should not be allowed. But I understand that Hibernate is using lots of Reflections and IOs and I also presume that hibernate doesn't provide Resource Adapter(not a JCA application) so, what is the guarantee that hibernate will work well in all the servers. Eventhough major application severs support IO and Reflections there is no guarantee that all the servers will support.
b) ThreadLocal - It is a good idea to use ThreadLocal to have 1 session for 1 user transaction. But then in J2EE servers there is no guarantee that only 1 thread will be used for 1 user transaction. For e.g In a multi-noded/clustered environment Bean A(running on node X) calling to Bean B (deployed on node X and node Y) may execute on node Y also. In this case calling ThreadLocal.get in Bean B will not be successfull right?
Thank you in advance.
cheers
gupta.
|