Questions tagged [sessionfactory]

A main interface used by the application to obtain a Hibernate session.

A main interface used by the application to obtain a Hibernate session. Hibernate requires to provide it with the configuration information required to connect to each database being used by an application as well as which classes are mapped to a given database. Each one of these database-specific configuration files, along with the associated class mappings, are compiled and cached by the SessionFactory, which is used to obtain Hibernate sessions. The SessionFactory is a heavyweight object that should ideally be created only once (since it's an expensive and slow operation) and threads servicing client requests obtain Session instances from this factory. Initially the SessionFactory should made available to the application that needs to perform persistence operations.

424 questions
-1
votes
1 answer

'Configuration().configure().buildSessionFactory()' returns a SessionFactory's object which is an interface not implemented by Configuration class?

How does the line Configuration().configure().buildSessionFactory() returns a SessionFactory's object which is an interface not implemented by Configuration class?
Kush
  • 35
  • 5
-1
votes
1 answer

Best Nhibernate session for asp.net

I'm new in nHibernate and I need some pros help. I want to make nhibernate session for long life cycle asp/net web application and what is best solution cuz i don't want to make some mistakes that for example client got session open for too…
Endiss
  • 639
  • 2
  • 10
  • 23
-2
votes
1 answer

Where does session factory's method define database to be used?

I'm creating Session factory object like following: SessionFactory factory = new Configuration().configure().buildSessionFactory(); Which class mentions the database which I've mentioned in *.hbm.xml file ?
Rajat Shah
  • 11
  • 4
-4
votes
1 answer

Null pointer exception thrown by sessionfactory in spring and hibernate

Exception while assigning the session factory java.lang.NullPointerException at com.span.hotelmanagement.persistance.CustomerDAOImpl.saveCustomer(CustomerDAOImpl.java:41) at…
1 2 3
28
29