How can we bind hibernate session factory to JNDI ?



How can we bind hibernate session factory to JNDI ?..

Answer / Akash Deep Gyan

To bind Hibernate Session Factory to JNDI, you need to follow these steps: 1. Create a custom ServiceResourceFactory implementation that will create the SessionFactory instance and register it with JNDI. 2. Configure Hibernate properties in your application's configuration file (web.xml or standalone.xml) to use the custom factory for creating SessionFactory. 3. Lookup the SessionFactory from JNDI in your code using the JNDI name you used during registration.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Hibernate Interview Questions

Why is orm used?

1 Answers  


What is ehcache in hibernate?

1 Answers  


What is transient state in hibernate ?

1 Answers  


What is detached in hibernate?

1 Answers  


What is the use of hbm2ddl configuration in hibernate?

1 Answers  


What are the main advantages of orm like hibernate?

1 Answers  


How to implement database relationship in hibernate?

1 Answers  


What is table per concrete class in hibernate?

1 Answers  


What is criteria api?

1 Answers  


What is hql in hibernate?

1 Answers  


What is the use of sessionfactory in hibernate?

1 Answers  


What is the difference between merge and update?

1 Answers  


Categories