Skip to content

Commit

Permalink
Merge branch 'master' into release-1.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
niveathika committed Aug 29, 2024
2 parents 7f62af0 + cb88b85 commit d65ce34
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 25 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Follow one of the following ways to add the corresponding database JAR in the fi

### Client
To access a database, you must first create a
[`jdbc:Client`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest/clients/Client) object.
[`jdbc:Client`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest#Client) object.
The samples for creating a JDBC client can be found below.

> **Tip**: The client should be used throughout the application lifetime.
Expand Down Expand Up @@ -60,9 +60,9 @@ jdbc:Client|sql:Error dbClient = new (
```

In the sample below, the `jdbc:Client` uses the named parameters to pass all the attributes and provides the `options` property in the type of
[`jdbc:Options`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest/records/Options),
[`jdbc:Options`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest#Options),
and also uses the unshared connection pool in the type of
[`sql:ConnectionPool`](https://docs.central.ballerina.io/ballerina/sql/latest/records/ConnectionPool).
[`sql:ConnectionPool`](https://docs.central.ballerina.io/ballerina/sql/latest#ConnectionPool).
For more information about connection pooling, see the [`sql` library](https://docs.central.ballerina.io/ballerina/sql/latest).

E.g., The DB client creation for an H2 database will be as follows.
Expand All @@ -80,7 +80,7 @@ jdbc:Client|sql:Error dbClient = new (
```

The `jdbc:Client` receives some custom properties within the
[`jdbc:Options`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest/records/Options)
[`jdbc:Options`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest#Options)
and those properties will be used by the defined `datasourceName`.
As per the provided sample, the `org.h2.jdbcx.JdbcDataSource` datasource will be configured with a `loginTimeout`
of `2000` milliseconds.
Expand All @@ -98,16 +98,16 @@ jdbc:Client|sql:Error dbClient = new (
```

You can find more details about each property in the
[`jdbc:Client`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest/clients/Client) constructor.
[`jdbc:Client`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest#Client) constructor.

The [`jdbc:Client`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest/clients/Client) references
[`sql:Client`](https://docs.central.ballerina.io/ballerina/sql/latest/clients/Client) and
The [`jdbc:Client`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest#Client) references
[`sql:Client`](https://docs.central.ballerina.io/ballerina/sql/latest#Client) and
all the operations defined by the `sql:Client` will be supported by the `jdbc:Client` as well.

#### Handle connection pools

All database libraries share the same connection pooling concept and there are three possible scenarios for
connection pool handling. For its properties and possible values, see the [`sql:ConnectionPool`](https://docs.central.ballerina.io/ballerina/sql/latest/records/ConnectionPool).
connection pool handling. For its properties and possible values, see the [`sql:ConnectionPool`](https://docs.central.ballerina.io/ballerina/sql/latest#ConnectionPool).

>**Note**: Connection pooling is used to optimize opening and closing connections to the database. However, the pool comes with an overhead. It is best to configure the connection pool properties as per the application need to get the best performance.
Expand Down Expand Up @@ -547,6 +547,6 @@ All contributors are encouraged to read the [Ballerina code of conduct](https://
## Useful links

* For more information go to the [`JDBC` library](https://lib.ballerina.io/ballerinax/java.jdbc/latest).
* For example demonstrations of the usage, go to [Ballerina By Examples](https://ballerina.io/learn/by-example/jdbc-query-operation.html).
* For example demonstrations of the usage, go to [Ballerina By Examples](https://ballerina.io/learn/by-example/#database-access).
* Chat live with us via our [Discord server](https://discord.gg/ballerinalang).
* Post all technical questions on Stack Overflow with the [#ballerina](https://stackoverflow.com/questions/tagged/ballerina) tag.
16 changes: 8 additions & 8 deletions ballerina/Module.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Follow one of the following ways to add the corresponding database JAR in the fi

### Client
To access a database, you must first create a
[`jdbc:Client`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest/clients/Client) object.
[`jdbc:Client`](https://central.ballerina.io/ballerinax/java.jdbc/latest#Client) object.
The samples for creating a JDBC client can be found below.

> **Tip**: The client should be used throughout the application lifetime.
Expand Down Expand Up @@ -53,9 +53,9 @@ jdbc:Client|sql:Error dbClient = new (
```

In the sample below, the `jdbc:Client` uses the named parameters to pass all the attributes and provides the `options` property in the type of
[`jdbc:Options`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest/records/Options),
[`jdbc:Options`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest#Options),
and also uses the unshared connection pool in the type of
[`sql:ConnectionPool`](https://docs.central.ballerina.io/ballerina/sql/latest/records/ConnectionPool).
[`sql:ConnectionPool`](https://docs.central.ballerina.io/ballerina/sql/latest#ConnectionPool).
For more information about connection pooling, see the [`sql` module](https://docs.central.ballerina.io/ballerina/sql/latest).

E.g., The DB client creation for an H2 database will be as follows.
Expand All @@ -73,7 +73,7 @@ jdbc:Client|sql:Error dbClient = new (
```

The `jdbc:Client` receives some custom properties within the
[`jdbc:Options`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest/records/Options)
[`jdbc:Options`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest#Options)
and those properties will be used by the defined `datasourceName`.
As per the provided sample, the `org.h2.jdbcx.JdbcDataSource` datasource will be configured with a `loginTimeout`
of `2000` milliseconds.
Expand All @@ -91,16 +91,16 @@ jdbc:Client|sql:Error dbClient = new (
```

You can find more details about each property in the
[`jdbc:Client`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest/clients/Client) constructor.
[`jdbc:Client`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest#Client) constructor.

The [`jdbc:Client`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest/clients/Client) references
[`sql:Client`](https://docs.central.ballerina.io/ballerina/sql/latest/clients/Client) and
The [`jdbc:Client`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest#Client) references
[`sql:Client`](https://docs.central.ballerina.io/ballerina/sql/latest#Client) and
all the operations defined by the `sql:Client` will be supported by the `jdbc:Client` as well.

#### Handle connection pools

All database modules share the same connection pooling concept and there are three possible scenarios for
connection pool handling. For its properties and possible values, see the [`sql:ConnectionPool`](https://docs.central.ballerina.io/ballerina/sql/latest/records/ConnectionPool).
connection pool handling. For its properties and possible values, see the [`sql:ConnectionPool`](https://docs.central.ballerina.io/ballerina/sql/latest#ConnectionPool).

>**Note**: Connection pooling is used to optimize opening and closing connections to the database. However, the pool comes with an overhead. It is best to configure the connection pool properties as per the application need to get the best performance.
Expand Down
16 changes: 8 additions & 8 deletions ballerina/Package.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Follow one of the following ways to add the corresponding database JAR in the fi

### Client
To access a database, you must first create a
[`jdbc:Client`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest/clients/Client) object.
[`jdbc:Client`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest#Client) object.
The samples for creating a JDBC client can be found below.

> **Tip**: The client should be used throughout the application lifetime.
Expand Down Expand Up @@ -53,9 +53,9 @@ jdbc:Client|sql:Error dbClient = new (
```

In the sample below, the `jdbc:Client` uses the named parameters to pass all the attributes and provides the `options` property in the type of
[`jdbc:Options`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest/records/Options),
[`jdbc:Options`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest#Options),
and also uses the unshared connection pool in the type of
[`sql:ConnectionPool`](https://docs.central.ballerina.io/ballerina/sql/latest/records/ConnectionPool).
[`sql:ConnectionPool`](https://docs.central.ballerina.io/ballerina/sql/latest#ConnectionPool).
For more information about connection pooling, see the [`sql` package](https://docs.central.ballerina.io/ballerina/sql/latest).

E.g., The DB client creation for an H2 database will be as follows.
Expand All @@ -73,7 +73,7 @@ jdbc:Client|sql:Error dbClient = new (
```

The `jdbc:Client` receives some custom properties within the
[`jdbc:Options`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest/records/Options)
[`jdbc:Options`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest#Options)
and those properties will be used by the defined `datasourceName`.
As per the provided sample, the `org.h2.jdbcx.JdbcDataSource` datasource will be configured with a `loginTimeout`
of `2000` milliseconds.
Expand All @@ -91,16 +91,16 @@ jdbc:Client|sql:Error dbClient = new (
```

You can find more details about each property in the
[`jdbc:Client`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest/clients/Client) constructor.
[`jdbc:Client`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest#Client) constructor.

The [`jdbc:Client`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest/clients/Client) references
[`sql:Client`](https://docs.central.ballerina.io/ballerina/sql/latest/clients/Client) and
The [`jdbc:Client`](https://docs.central.ballerina.io/ballerinax/java.jdbc/latest#Client) references
[`sql:Client`](https://docs.central.ballerina.io/ballerina/sql/latest#Client) and
all the operations defined by the `sql:Client` will be supported by the `jdbc:Client` as well.

#### Handle connection pools

All database packages share the same connection pooling concept and there are three possible scenarios for
connection pool handling. For its properties and possible values, see the [`sql:ConnectionPool`](https://docs.central.ballerina.io/ballerina/sql/latest/records/ConnectionPool).
connection pool handling. For its properties and possible values, see the [`sql:ConnectionPool`](https://docs.central.ballerina.io/ballerina/sql/latest#ConnectionPool).

>**Note**: Connection pooling is used to optimize opening and closing connections to the database. However, the pool comes with an overhead. It is best to configure the connection pool properties as per the application need to get the best performance.
Expand Down
9 changes: 9 additions & 0 deletions load-tests/cache/results/summary.csv
Original file line number Diff line number Diff line change
Expand Up @@ -646,3 +646,12 @@ HTTP Request,15634039,12,9,28,34,47,0,315,0.00%,4492.7,1057.0,10.63,1723846563,5
HTTP Request,15700030,12,9,27,34,47,0,239,0.00%,4511.8,1061.5,10.63,1723932912,50,60
HTTP Request,16450503,11,8,26,33,46,0,191,0.00%,4727.4,1112.2,10.29,1724019357,50,60
HTTP Request,15540600,12,9,28,34,48,0,235,0.00%,4465.9,1050.7,10.92,1724105819,50,60
HTTP Request,15152516,12,9,29,36,50,0,229,0.00%,4354.4,1024.5,11.40,1724192256,50,60
HTTP Request,16461168,11,9,26,31,44,0,310,0.00%,4730.5,1112.9,9.75,1724278548,50,60
HTTP Request,14518877,13,10,28,34,49,0,302,0.00%,4172.2,981.6,10.93,1724364990,50,60
HTTP Request,15079983,12,9,29,35,50,0,312,0.00%,4333.5,1019.5,11.25,1724451323,50,60
HTTP Request,14885758,13,10,29,35,49,0,322,0.00%,4277.6,1006.4,11.12,1724537731,50,60
HTTP Request,15486733,12,9,28,35,48,0,296,0.00%,4450.5,1047.1,10.90,1724624093,50,60
HTTP Request,16038543,12,9,27,33,46,0,181,0.00%,4609.0,1084.4,10.39,1724710501,50,60
HTTP Request,16779399,11,8,26,32,45,0,328,0.00%,4821.9,1134.4,10.05,1724796910,50,60
HTTP Request,14531895,13,10,29,35,49,0,251,0.00%,4176.0,982.5,11.09,1724883684,50,60
9 changes: 9 additions & 0 deletions load-tests/cache_with_cleanup_task/results/summary.csv
Original file line number Diff line number Diff line change
Expand Up @@ -647,3 +647,12 @@ HTTP Request,15998948,12,9,27,33,45,0,290,0.00%,4597.5,1081.7,10.19,1723850545,5
HTTP Request,15602997,12,9,28,34,47,0,309,0.00%,4483.9,1054.9,10.62,1723936856,50,60
HTTP Request,16716157,11,9,25,31,43,0,421,0.00%,4803.7,1130.2,9.63,1724023299,50,60
HTTP Request,15101226,12,9,28,35,49,0,385,0.00%,4339.6,1021.0,10.99,1724109749,50,60
HTTP Request,15424871,12,9,28,34,47,0,244,0.00%,4432.7,1042.9,10.61,1724196218,50,60
HTTP Request,15743680,12,9,27,33,46,0,357,0.00%,4524.3,1064.4,10.29,1724282504,50,60
HTTP Request,14459417,13,10,28,34,48,0,292,0.00%,4155.2,977.6,10.78,1724368966,50,60
HTTP Request,15088217,12,10,28,33,47,0,334,0.00%,4335.9,1020.1,10.51,1724455253,50,60
HTTP Request,14932203,12,10,28,34,47,0,289,0.00%,4291.1,1009.6,10.68,1724541653,50,60
HTTP Request,15561281,12,9,27,33,46,0,334,0.00%,4471.9,1052.1,10.41,1724628003,50,60
HTTP Request,15690884,12,9,27,33,46,0,457,0.00%,4509.1,1060.9,10.32,1724714445,50,60
HTTP Request,16472788,11,9,26,32,45,0,354,0.00%,4733.8,1113.7,10.11,1724801045,50,60
HTTP Request,12503203,15,10,30,39,105,0,30030,2.10%,3593.1,860.3,35.85,1724887658,50,60
9 changes: 9 additions & 0 deletions load-tests/non_cache/results/summary.csv
Original file line number Diff line number Diff line change
Expand Up @@ -649,3 +649,12 @@ HTTP Request,8849340,22,13,47,53,68,0,30097,0.01%,2523.7,594.3,301.56,1723854489
HTTP Request,9478053,21,12,45,51,65,0,30061,0.01%,2719.8,640.5,286.62,1723940767,50,60
HTTP Request,9769183,20,12,45,51,64,0,30066,0.01%,2791.3,657.3,285.41,1724027250,50,60
HTTP Request,7676261,26,13,52,76,117,0,30078,7.01%,2192.5,546.8,289.37,1724113693,50,60
HTTP Request,9398147,21,12,46,52,66,0,30063,0.01%,2678.1,630.6,286.18,1724200228,50,60
HTTP Request,6301504,32,14,82,102,166,0,30056,16.92%,1810.8,487.1,281.07,1724286458,50,60
HTTP Request,4970116,41,20,99,114,183,0,30059,24.59%,1428.2,405.9,282.93,1724372855,50,60
HTTP Request,9227412,21,13,45,52,66,0,30069,0.01%,2638.5,621.3,292.33,1724459184,50,60
HTTP Request,9071766,22,13,46,53,67,0,30076,0.01%,2585.6,608.9,294.33,1724545578,50,60
HTTP Request,9426519,21,12,45,52,65,0,30075,0.01%,2699.7,635.7,291.37,1724631945,50,60
HTTP Request,9589103,20,12,44,51,64,0,30076,0.01%,2736.1,644.3,288.89,1724718375,50,60
HTTP Request,9841512,20,12,44,50,64,0,30052,0.01%,2824.8,665.2,282.73,1724804969,50,60
HTTP Request,8633286,23,14,47,54,69,0,30074,0.01%,2460.0,579.3,301.70,1724891583,50,60

0 comments on commit d65ce34

Please sign in to comment.