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 does application client module contain?

545


What is sandbox in java?

501


Which java ide is best?

494


Why class is used in java?

484


Explain connector architecture.

542






How do I run java?

472


Define thin client?

510


Define authorization constraint?

539


What is non primitive data type in java?

492


What is a java application client?

522


Is c++ more secure than java?

499


What is java servlet container?

508


What do you mean by j2ee module?

528


What is container-managed sign-on?

545


What is actionform?

546