What is the difference between sessionfactory and session in hibernate?



What is the difference between sessionfactory and session in hibernate?..

Answer / Jyoti Arya

In Hibernate, SessionFactory is a factory object that creates Sessions. It's a thread-safe and long-lived entity that should be initialized once during the application lifecycle. On the other hand, Session is an interface representing the current session with the database.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Hibernate Interview Questions

Why default constructor is required in hibernate?

1 Answers  


What is the difference between sessionfactory and session in hibernate?

1 Answers  


Why we use hibernate?

1 Answers  


Which is better nhibernate or entity framework?

1 Answers  


Can I reuse the session in hibernate?

1 Answers  


Is ef an orm?

1 Answers  


Explain the advantages of hibernate?

1 Answers  


What is cascadetype in hibernate?

1 Answers  


Difference between sorted and ordered collection in hibernate?

1 Answers  


Difference between save() and saveorupdate() in hibernate?

1 Answers  


Why do you need orm tools like hibernate?

1 Answers  


Why hibernate?

1 Answers  


Categories