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 core java and j2ee?

653


What is the difference between load() and get()?

723


What is actionform?

705


What is layout in java?

665


What software is needed for java programming?

605






What is non primitive data type in java?

667


What are struts?

664


What is commit?

797


Who generates bytecode in java?

715


What is a java application server?

649


What is a component in java?

620


Explain j2ee architecture.

766


What is filter chain?

683


What is meant by j2ee?

657


What is a j2ee container?

718