C3P0 connection do the Close method actually destroy the connection object after the connection pool is obtained?

Source: Internet
Author: User

Background:

C3P0 Connection Pool

Jdbc.maxpoolsize=1
Jdbc.minpoolsize=1
Jdbc.initialpoolsize=1

Connection conn = Datasource.getconnection ()

After the Close method is executed, the connection is really closed instead of being put back in the connection pool.

I found a lot of people on the Internet. After using the connection pool, connection's Close method is not really closed, just put it back in the pool for use.

I always like to go to the bottom, in fact, Curiosity killed the cat. So I couldn't help but test it.

First time:

[Email protected] [Wrapping: [email protected]]

Second time:

[Email protected] [Wrapping: [email protected]]

The above statement should be correct.

[Email protected] is the same object, that is, the same connection.

C3P0 connection do the Close method actually destroy the connection object after the connection pool is obtained?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.