Can we create two sessionfactory in hibernate?
Answer / Sarvesh Kumar
No, it is not recommended to have multiple SessionFactory instances for a single Hibernate application because they are thread-unsafe and expensive to create. Instead, use Configuration.configure() method to configure one and obtain the SessionFactory instance using Configuration.buildSessionFactory(ServiceRegistry serviceRegistry).
| Is This Answer Correct ? | 0 Yes | 0 No |
What is the difference between session.save() and session.persist() method?
What is indexing in hibernate?
What is lazy initialization in hibernate?
What is the difference between update and upgrade?
Why do we need hql?
What is detached object in hibernate?
How do you implement one to one relationship in hibernate with java annotation?
What is fetchtype lazy in hibernate?
What is meant by full object mapping?
What are the annotations used in hibernate?
What is the difference between get and load method?
What is the difference between load() and get() method in hibernate?