1

What is difference between singleton and connection pooling? or are they similar?

1 Answer 1

4

Singleton is a design pattern that restricts the instantiation of a class to one object.

Connection Pooling is an implementation of Object pool pattern that uses a set of initialized objects kept ready to use – a "pool" – rather than allocating and destroying them on demand. In this case Objects are Connections.

Sign up to request clarification or add additional context in comments.

2 Comments

In singleton same happens right? the object is not destroyed. Same copy is given to all
A Connection Pool of size 1 would be the same as a Singleton but a Connection Pool is also used to create abstraction in connections maintenance process and optimize memory use. Singleton is often used to be sure you wont get more than one instance of the Class, not always to reduce memory use. Not exactly the same intent.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.