Why we use singleton class in hibernate sessionfactory?

Why we use singleton class in hibernate sessionfactory?

Hello,

Please tell me why we use singleton class in hibernate sessionfactory? hibernate sessionfactory singleton example would be very helpful.

Thanks...

View Answers

January 28, 2014 at 5:09 PM

Hello,

A singleton is an class that can be instantiated once, and only once. Implementation of Singleton is simple, block off access to all constructors, provide a static method for getting an instance of the singleton, and prevent cloning..

For detailed explanation go through the following link:

Thanks..









Related Tutorials/Questions & Answers:
Why we use singleton class in hibernate sessionfactory?
why we use abstract class in java?
Advertisements
singleton class
Why we need reload application after class change?
for writting java program why we are taking more than one class
Why do we use ORM?
Why to use Session interface in Hibernate?
where singleton class used in java - Java Interview Questions
why we use constructors instead of methods in java?
singleton class in struts - Java Beginners
singleton class in struts - Java Beginners
singleton class in struts - Java Beginners
singleton class in struts - Java Beginners
arrays,why we cannot use this statement
arrays,why we cannot use this statement
why we use design patterns in java?Example?
why crieterias are importent in hibernate?
Why Abstract Class?
Why Abstract Class?
Why we use Semicolon after SQL Statements?
why we use struts framework instead of springs
why we use ^ operator in sql, and what is the meaning of that operator?
Singleton class
Why hibernate is used?
Why we should use string args[] in main method in java?
why java file save as its class name
Why System class not in jsp - JSP-Servlet
Why the wait(),notify() should not avaialable in Thread class.
Why we need data science?
why and where we use setter and getter methods in java, please give me one example program.....
can we use class in jsp which implements interface
where exactly we use interface and where abstract class?
can we use scanner class,class , object and methods to get output without using constructor ????
singleton
how to use sequence as a generator class in hibernate for ms sql
Why Dose Hibernate Run Very Slow?
Why should we learn R programming?
Why should we learn R programming?
Why should we learn R programming?
Hibernate error class is not mapped
Why does Java provide both abstract class as well as interface
hibernate
why should we install the ADempiere in company - Development process
Explain the persistence class in hibernate?
Why would we want a Database?
Maven dependency for com.github.honoluluhenk.id-class - id-class-jpa-hibernate-integration version 1.0.1 is released. Learn to use id-class-jpa-hibernate-integration version 1.0.1 in Maven based Java projects
Maven dependency for com.github.honoluluhenk.id-class - id-class-jpa-hibernate-integration version 1.0.0 is released. Learn to use id-class-jpa-hibernate-integration version 1.0.0 in Maven based Java projects
Maven dependency for com.github.honoluluhenk.id-class - id-class-jpa-hibernate-integration version 0.0.4 is released. Learn to use id-class-jpa-hibernate-integration version 0.0.4 in Maven based Java projects
Maven dependency for com.github.honoluluhenk.id-class - id-class-jpa-hibernate-integration version 0.0.3 is released. Learn to use id-class-jpa-hibernate-integration version 0.0.3 in Maven based Java projects
why should we over ride hashCode(), when equals was over ride()?

Ads