Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add missing connection documentation, fix spelling #846

Merged
merged 3 commits into from Jun 26, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
48 changes: 37 additions & 11 deletions docs/documentation/head/connect.md
Expand Up @@ -176,18 +176,15 @@ Connection conn = DriverManager.getConnection(url);
It captures a stacktrace at each `Connection` opening and if the `finalize()`
method is reached without having been closed the stacktrace is printed
to the log.

* **autosave** = String

* **autoCloseUnclosedStatements** = boolean

Clients may leak `Statement` objects by failing to call its `close()` method.
If `autoCloseUnclosedStatements` is set to "true" then finalizer will be used
as a stopgap solution to `close()` the resource.
Specifies what the driver should do if a query fails. In `autosave=always` mode, JDBC driver sets a savepoint before each query,
and rolls back to that savepoint in case of failure. In `autosave=never` mode (default), no savepoint dance is made ever.
In `autosave=conservative` mode, savepoint is set for each query, however the rollback is done only for rare cases
like 'cached statement cannot change return type' or 'statement XXX is not valid' so JDBC driver rollsback and retries

*Note:* *Creating finalizable objects is very expensive in lots of JVM.
It dramatically impacts `Statement` instantiation
and increases time spent in garbage collection, so avoid using `autoCloseUnclosedStatements`="true"
for highly loaded applications unless you are sure your JVM can crater
finalizer traffic.*
The default is `never`

* **binaryTransferEnable** = String

Expand Down Expand Up @@ -228,6 +225,16 @@ Connection conn = DriverManager.getConnection(url);
The main aim of this setting is to prevent `OutOfMemoryError`.
The value of 0 disables the cache.

* **preferQueryMode** = String

Specifies which mode is used to execute queries to database: simple means ('Q' execute, no parse, no bind, text mode only),
extended means always use bind/execute messages, extendedForPrepared means extended for prepared statements only,
extendedCacheEverything means use extended protocol and try cache every statement
(including Statement.execute(String sql)) in a query cache.
extended | extendedForPrepared | extendedCacheEverything | simple

The default is extended

* **defaultRowFetchSize** = int

Determine the number of rows fetched in `ResultSet`
Expand Down Expand Up @@ -257,6 +264,13 @@ Connection conn = DriverManager.getConnection(url);
detecting network problems. The timeout is specified in seconds and a
value of zero means that it is disabled.

* **cancelSignalTimeout** = int

Cancel command is sent out of band over its own connection, so cancel message can itself get
stuck. This property controls "connect timeout" and "socket timeout" used for cancel commands.
The timeout is specified in seconds. Default value is 10 seconds.


* **tcpKeepAlive** = boolean

Enable or disable TCP keep-alive probe. The default is `false`.
Expand Down Expand Up @@ -343,7 +357,9 @@ Connection conn = DriverManager.getConnection(url);

* **disableColumnSanitiser** = boolean

Enable optimization that disables column name sanitiser.
Setting this to true disables column name sanitiser.
The sanitiser folds columns in the resultset to lowercase.
The default is to sanitise the columns (off).

* **assumeMinServerVersion** = String

Expand Down Expand Up @@ -391,6 +407,16 @@ Connection conn = DriverManager.getConnection(url);
This will change batch inserts from insert into foo (col1, col2, col3) values (1,2,3) into
insert into foo (col1, col2, col3) values (1,2,3), (4,5,6) this provides 2-3x performance improvement

* **replication** = String

Connection parameter passed in the startup message. This parameter accepts two values; "true"
and `database`. Passing `true` tells the backend to go into walsender mode, wherein a small set
of replication commands can be issued instead of SQL statements. Only the simple query protocol
can be used in walsender mode. Passing "database" as the value instructs walsender to connect
to the database specified in the dbname parameter, which will allow the connection to be used
for logical replication from that database. <p>Parameter should be use together with
`assumeMinServerVersion` with parameter >= 9.4 (backend >= 9.4)

<a name="connection-failover"></a>
## Connection Fail-over

Expand Down
12 changes: 6 additions & 6 deletions pgjdbc/src/main/java/org/postgresql/PGProperty.java
Expand Up @@ -364,7 +364,7 @@ public enum PGProperty {
/**
* Specifies which mode is used to execute queries to database: simple means ('Q' execute, no parse, no bind, text mode only),
* extended means always use bind/execute messages, extendedForPrepared means extended for prepared statements only,
* extendedCacheEveryting means use extended protocol and try cache every statement (including Statement.execute(String sql)) in a query cache.
* extendedCacheEverything means use extended protocol and try cache every statement (including Statement.execute(String sql)) in a query cache.
*
* This mode is meant for debugging purposes and/or for cases when extended protocol cannot be used (e.g. logical replication protocol)
*/
Expand All @@ -375,14 +375,14 @@ public enum PGProperty {
"extended", "extendedForPrepared", "extendedCacheEveryting", "simple"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fixed the property too? "extendedCacheEveryting" => "extendedCacheEverything"


/**
* Specifies what the driver should do if a query fails. In {@code autosave=always} mode, JDBC driver sets a safepoint before each query,
* and rolls back to that safepoint in case of failure. In {@code autosave=never} mode (default), no safepoint dance is made ever.
* In {@code autosave=conservative} mode, safepoint is set for each query, however the rollback is done only for rare cases
* Specifies what the driver should do if a query fails. In {@code autosave=always} mode, JDBC driver sets a savepoint before each query,
* and rolls back to that savepoint in case of failure. In {@code autosave=never} mode (default), no savepoint dance is made ever.
* In {@code autosave=conservative} mode, savepoint is set for each query, however the rollback is done only for rare cases
* like 'cached statement cannot change return type' or 'statement XXX is not valid' so JDBC driver rollsback and retries
*/
AUTOSAVE("autosave", "never",
"Specifies what the driver should do if a query fails. In autosave=always mode, JDBC driver sets a safepoint before each query, "
+ "and rolls back to that safepoint in case of failure. In autosave=never mode (default), no safepoint dance is made ever. "
"Specifies what the driver should do if a query fails. In autosave=always mode, JDBC driver sets a savepoint before each query, "
+ "and rolls back to that savepoint in case of failure. In autosave=never mode (default), no savepoint dance is made ever. "
+ "In autosave=conservative mode, safepoint is set for each query, however the rollback is done only for rare cases"
+ " like 'cached statement cannot change return type' or 'statement XXX is not valid' so JDBC driver rollsback and retries", false,
"always", "never", "conservative"),
Expand Down