Skip to content

Commit 88b1ce0

Browse files
committed
jdbc interpreter datasource connection pool document
1 parent 1f2eb55 commit 88b1ce0

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/interpreter/jdbc.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,25 @@ The last step is **Dependency Setting**. Since Zeppelin only includes `PostgreSQ
156156

157157
That's it. You can find more JDBC connection setting examples([Mysql](#mysql), [MariaDB](#mariadb), [Redshift](#redshift), [Apache Hive](#apache-hive), [Apache Phoenix](#apache-phoenix), and [Apache Tajo](#apache-tajo)) in [this section](#examples).
158158

159+
## JDBC Interpreter Datasource Pool Configuration
160+
The Jdbc interpreter uses the connection pool technology, and supports users to do some personal configuration of the connection pool. For example, we can configure `default.validationQuery='select 1'` and `default.testOnBorrow=true` in the Interpreter configuration to avoid the "Invalid SessionHandle" runtime error caused by Session timeout when connecting to HiveServer2 through JDBC interpreter.
161+
162+
The Jdbc Interpreter supports the following database connection pool configurations:
163+
164+
| Property Name | Default | Description |
165+
|----------------------------------------------------------------------------------------------------------------------------------------|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
166+
| testOnBorrow | false | The indication of whether objects will be validated before being borrowed from the pool. If the object fails to validate, it will be dropped from the pool, and we will attempt to borrow another. |
167+
| testOnCreate | false | The indication of whether objects will be validated after creation. If the object fails to validate, the borrow attempt that triggered the object creation will fail. |
168+
| testOnReturn | false | The indication of whether objects will be validated before being returned to the pool. |
169+
| testWhileIdle | false | The indication of whether objects will be validated by the idle object evictor (if any). If an object fails to validate, it will be dropped from the pool. |
170+
| timeBetweenEvictionRunsMillis | -1L | The number of milliseconds to sleep between runs of the idle object evictor thread. When non-positive, no idle object evictor thread will be run. |
171+
| maxWaitMillis | -lL | The maximum number of milliseconds that the pool will wait (when there are no available connections) for a connection to be returned before throwing an exception, or -1 to wait indefinitely. |
172+
| maxIdle | 8 | The maximum number of connections that can remain idle in the pool, without extra ones being released, or negative for no limit. |
173+
| minIdle | 0 | The minimum number of connections that can remain idle in the pool, without extra ones being created, or zero to create none. |
174+
| maxTotal | -1 | The maximum number of active connections that can be allocated from this pool at the same time, or negative for no limit. |
175+
| validationQuery | show database | The SQL query that will be used to validate connections from this pool before returning them to the caller. If specified, this query MUST be an SQL SELECT statement that returns at least one row. If not specified, connections will be validation by calling the isValid() method. |
176+
177+
159178
## More properties
160179
There are more JDBC interpreter properties you can specify like below.
161180

0 commit comments

Comments
 (0)