如何在WEBLOGIC 9.2服务器中使用JNDI访问Hibernate的SessionFactory? [英] How to access SessionFactory of Hibernate using JNDI in WEBLOGIC 9.2 server?
本文介绍了如何在WEBLOGIC 9.2服务器中使用JNDI访问Hibernate的SessionFactory?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们正在使用Weblogoic9.2.3& DB是Oracle10.2.0.3. 我们如何使用JNDI访问Hibernate SessionFactory?
We are using Weblogoic9.2.3 & DB is Oracle10.2.0.3. How can we access Hibernate SessionFactory using JNDI?
推荐答案
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>
...
这篇关于如何在WEBLOGIC 9.2服务器中使用JNDI访问Hibernate的SessionFactory?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文