We are using Weblogoic9.2.3 & DB is Oracle10.2.0.3. How can we access Hib开发者_JS百科ernate 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>
...
精彩评论