# US 11,120,036 B2 · System and method for efficient repurposing of connections in a multi-tenant database environment

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 11,120,036 B2
- Document ID: US11120036B2
- Status: Granted
- Kind: B2
- Application number: 15/227,899
- Filed: 2016-08-03
- Published: 2018-02-08
- Granted: 2021-09-14
- Earliest claimed: 2016-08-03
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: Jean de Lavarene; Yuri Dolgov; Vidya Hegde; Saurabh Verma; Krishna Chandra; Aramvalarthanathan Namachivayam
- Web page: https://patentgrep.com/patent/US11120036B2

## CPC

- G06F 16/25: Integrating or interfacing systems involving database management systems
- G06F 9/5061: {Partitioning or combining of resources}
- G06F 16/24552: {Database cache management}
- H04L 67/10: in which an application is distributed across nodes in the network (software deployment G06F8/60; multiprogramming arrangements G06F9/46)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

Described herein are systems and methods for providing access to a database in a multi-tenant environment, including the use of a connection pool, with support for efficient repurposing of connections. In accordance with an embodiment, a software application can request that a connection be provided, to enable access to the database. In response to receiving the request, the connection pool can first determine if a particular connection with the exact desired attributes already exists within the pool, but is borrowed at the time of the request. If such a connection exists, then the connection pool can wait a period of time for that particular connection to become available, referred to herein as a double-wait. Subsequently, if the particular connection is not made available within the double-wait time period, the connection pool resumes its usual operation, for example by repurposing other connections.

## Claims

### Claim 1

A system for providing access to a database, including support for efficient repurposing of connections, comprising:
a computer including a processor, and at least one of an application server or database environment executing thereon;
wherein the system controls creation and use of connection objects in a connection pool that enables software applications to request a connection from the connection pool, and use a provided connection to access a database; and
wherein the system determines a value for a connection wait time period defined by a configurable connection pool property, and dynamically calculates a value for a double-wait time period that is proportional to an average connection borrow time interval, subject to a maximal value, wherein in response to receiving a request for a connection with the desired attributes,
during the double-wait time period associated with the request, operating in a double-wait mode, including:
determining if a particular connection with the desired attributes already exists within the connection pool, but is borrowed at time of the request; and
if the particular connection with the desired attributes already exists within the connection pool, but is borrowed at the time of the request, then waiting and polling during the double-wait time period that is less than the connection wait time period, for the particular connection with the desired attributes to become available for re-use; and
if the particular connection with the desired attributes does not become available for re-use during the double-wait time period, then upon completion of the double-wait time period associated with the request, reverting to a single-wait mode, including continuing to wait and poll while determining, during a remainder of the connection wait time period, to one of create or repurpose another connection to have the desired attributes.

### Claim 2 (depends on 1)

The system of claim 1, wherein the connection pool is polled using two different modes, including:
in a connection single-wait mode, the connection pool operates so that a borrow request expects any connection to show up available to be reserved, repurposed if needed, and then borrowed; and
in a connection double-wait mode, the connection pool operates so that a borrow request expects only a connection having the desired attributes, such that a repurpose is not needed.

### Claim 3 (depends on 1)

The system of claim 1, wherein the system enables software applications to associate particular labels with particular connection states.

### Claim 4 (depends on 1)

The system of claim 1, wherein each software application is associated with one or more tenants of the application server or database environment, or of a cloud-based or other networked environment.

### Claim 5 (depends on 1)

The system of claim 1, wherein the connection pool provides access to a multi-tenant database environment that includes one or more pluggable databases, wherein each pluggable database is associated with a tenant of the multi-tenant database environment.

### Claim 6

A method for providing access to a database, including support for efficient repurposing of connections, comprising:
providing, at a computer including a processor, at least one of an application server or database environment executing thereon, and a connection pool that includes connection objects and that enables software applications to request a connection from the connection pool, and use a provided connection to access a database;
determining a value for a connection wait time period defined by a configurable connection pool property, and dynamically calculating a value for a double-wait time period that is proportional to an average connection borrow time interval, subject to a maximal value, wherein in response to receiving a request for a connection with the desired attributes,
during the double-wait time period associated with the request, operating in a double-wait mode, including:
determining if a particular connection with the desired attributes already exists within the connection pool, but is borrowed at time of the request; and
if the particular connection with the desired attributes already exists within the connection pool, but is borrowed at the time of the request, then waiting and polling during the double-wait time period that is less than the connection wait time period, for the particular connection with the desired attributes to become available for re-use; and
if the particular connection with the desired attributes does not become available for re-use during the double-wait time period, then upon completion of the double-wait time period associated with the request, reverting to a single-wait mode, including continuing to wait and poll while determining, during a remainder of the connection wait time period, to one of create or repurpose another connection to have the desired attributes.

### Claim 7 (depends on 6)

The method of claim 6, wherein the connection pool is polled using two different modes, including:
in a connection single-wait mode, the connection pool operates so that a borrow request expects any connection to show up available to be reserved, repurposed if needed, and then borrowed; and
in a connection double-wait mode, the connection pool operates so that a borrow request expects only a connection having the desired attributes, such that a repurpose is not needed.

### Claim 8 (depends on 6)

The method of claim 6, wherein software applications are enabled to associate particular labels with particular connection states.

### Claim 9 (depends on 6)

The method of claim 6, wherein each software application is associated with one or more tenants of the application server or database environment, or of a cloud-based or other networked environment.

### Claim 10

A non-transitory computer readable storage medium, including instructions stored thereon which when read and executed by one or more computers cause the one or more computers to perform the method comprising:
providing, at a computer including a processor, at least one of an application server or database environment executing thereon, and a connection pool that includes connection objects and that enables software applications to request a connection from the connection pool, and use a provided connection to access a database;
determining a value for a connection wait time period defined by a configurable connection pool property, and dynamically calculating a value for a double-wait time period that is proportional to an average connection borrow time interval, subject to a maximal value, wherein in response to receiving a request for a connection with the desired attributes,
during the double-wait time period associated with the request, operating in a double-wait mode, including:
determining if a particular connection with the desired attributes already exists within the connection pool, but is borrowed at time of the request; and
if the particular connection with the desired attributes already exists within the connection pool, but is borrowed at the time of the request, then waiting and polling during the double-wait time period that is less than the connection wait time period, for the particular connection with the desired attributes to become available for re-use; and
if the particular connection with the desired attributes does not become available for re-use during the double-wait time period, then upon completion of the double-wait time period associated with the request, reverting to a single-wait mode, including continuing to wait and poll while determining, during a remainder of the connection wait time period, to one of create or repurpose another connection to have the desired attributes.

### Claim 11 (depends on 10)

The non-transitory computer readable storage medium of claim 10, wherein the connection pool is polled using two different modes, including:
in a connection single-wait mode, the connection pool operates so that a borrow request expects any connection to show up available to be reserved, repurposed if needed, and then borrowed; and
in a connection double-wait mode, the connection pool operates so that a borrow request expects only a connection having the desired attributes, such that a repurpose is not needed.

### Claim 12 (depends on 10)

The non-transitory computer readable storage medium of claim 10, wherein software applications are enabled to associate particular labels with particular connection states.
