本文从CommonsDBCPtestOnBorrow的作用机制着手,管中窥豹,从一点去分析数据库连接池获取的过程以及架构分层设计。以下内容会按照每层的作用,贯穿分析整个调用流程。1️⃣框架层commons-poolTheindicationofwhetherobjectswillbe validatedbeforebeingborrowed fromthepool.Iftheobjectfailstovalidate,itwillbedroppedfromthepool,andwewillattempttoborrowanother.testOnBorrow不是dbcp定义的,是commons