what is the purpose and activity of SessionFactory in
hibernate?

Answer Posted / yograj pandey

SessionFactory is Hibernate's concept of a single datastore
and is threadsafe so that many threads can access it
concurrently and request for sessions and immutable cache of
compiled mappings for a single database. A SessionFactory is
usually only built once at startup. SessionFactory should be
wrapped in some kind of singleton so that it can be easily
accessed in an application code.

SessionFactory sessionFactory = new
Configuration().configure().buildSessionfactory();

Is This Answer Correct ?    28 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is javabeans component?

605


What is actionform?

631


What is a java application client?

614


What is commit?

721


What is java web technologies?

583






Since we can create managed bean by two ways as, we can define the bean name in faces-config.xml file so that page can use that OR we can write annotation on bean class so that it is automatically assign to page but I want to know which one is good programming practice ? And also mention disadvantage of other which should not prefer ... Thanking you...

1966


Why java is oop language?

613


What is form-based authentication?

611


Describe orm?

597


What is front end technology in java?

540


What is j2ee server?

630


Is c++ more secure than java?

574


What is mean by connection pooling?

624


What is element?

618


Why is java important for internet?

541