How to access SessionFactory of Hibernate using JNDI in WEBLOGIC 9.2 server?

旧街凉风 提交于 2019-12-11 07:58:48

问题


We are using Weblogoic9.2.3 & DB is Oracle10.2.0.3. How can we access Hibernate SessionFactory using JNDI?


回答1:


I'd warmly suggest to read the chapter 3.8. J2EE Application Server integration of the documentation. But With Weblogic 9.x and Oracle 10g, you'll end up with something like this (partial but tested setup):

...
<property name="hibernate.session_factory_name">hibernate.SessionFactory</property> <!-- JNDI bound Session Factory Name -->
<property name="hibernate.jndi.url">t3://localhost:port</property>
<property name="hibernate.jndi.class">weblogic.jndi.WLInitialContextFactory</property>
<property name="hibernate.jndi.weblogic.jndi.replicateBindings">false</property> <!-- because SessionFactory is not clusterable -->
<property name="dialect">org.hibernate.dialect.Oracle10gDialect</property>
...


来源:https://stackoverflow.com/questions/1665086/how-to-access-sessionfactory-of-hibernate-using-jndi-in-weblogic-9-2-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!