Return to site

๐Ÿƒ๐ŸŽ“ SPRING CERTIFICATION QUESTION: When does the JDBC template acquire (and release) a connection ๐Ÿ”Œ - for every method called or once per template?

ยท spring,vcp,java

Answer:

๐‰๐๐›๐œ๐“๐ž๐ฆ๐ฉ๐ฅ๐š๐ญ๐ž acquires and releases connection of each called method.

๐‰๐๐›๐œ๐“๐ž๐ฆ๐ฉ๐ฅ๐š๐ญ๐ž source code confirms that (look at ๐‰๐๐›๐œ๐“๐ž๐ฆ๐ฉ๐ฅ๐š๐ญ๐ž#๐ž๐ฑ๐ž๐œ๐ฎ๐ญ๐ž ).

This connection acquiring/releasing strategy is used to minimize connection holding time allowing other clients to utilize free connections.

#spring #certificationquestion #vcp