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

How do I become a java developer?

480


What is the use of method save()?

523


What is java technology stack?

477


I Want build and release interview questions

3113


What is a java application client?

511






What is application assembler?

512


What is difference between java and core?

450


What is mean by j2ee?

471


What are the components of awt in java?

489


What should a junior java developer know?

470


What is a j2ee component?

499


What is Document Object Model?

542


How is java development environment setup?

467


What is B2B?

551


How many types of component events are in java?

470