Connection borrowing pattern¶
The Connection borrowing pattern is a data access mechanism where an application dynamically requests a database connection from a managed resource at runtime.^[600-developer__java__application-server__weblogic__weblogic-jdbc.md]
In this pattern, the application does not manage the connection lifecycle directly. Instead, it relies on a JDBC datasource—a resource object bound within a JNDI tree—which handles the provisioning of connections via an underlying connection pool^[600-developer__java__application-server__weblogic__weblogic-jdbc.md].
Operation¶
To utilize a connection, the application performs a lookup in the JNDI tree to retrieve the datasource.^[600-developer__java__application-server__weblogic__weblogic-jdbc.md] Once the datasource object is obtained, the application "borrows" a connection from the pool to perform database operations^[600-developer__java__application-server__weblogic__weblogic-jdbc.md].
Sources¶
- 600-developer__java__application-server__weblogic__weblogic-jdbc.md