[英]How to access SessionFactory of Hibernate using JNDI in WEBLOGIC 9.2 server?
我们使用的是Weblogoic9.2.3,数据库是Oracle10.2.0.3。 我们如何使用JNDI访问Hibernate SessionFactory?
我强烈建议阅读3.8章。 J2EE Application Server集成的文档。 但是,使用Weblogic 9.x和Oracle 10g,您将得到如下结果(部分但经过测试的设置):
...
<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>
...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.