Skip to content

Commit

Permalink
Made a number of NOTE-admonitions normal paragraphs
Browse files Browse the repository at this point in the history
+ typo fixes
  • Loading branch information
mrotteveel committed Aug 15, 2024
1 parent cf2e094 commit 7d21e6e
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 46 deletions.
11 changes: 7 additions & 4 deletions src/docs/asciidoc/chapters/connection/connection.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,13 @@ There, the driver is not on the system class path, so it will need to be loaded

We will leave out usages of `Class.forName` in further examples, they will work because of automatic driver loading.

[aside]
.Registering the JDBC driver
[NOTE]
====
****
There are several ways to register JDBC driver:
1. `DriverManager` loads the drivers from the system class path. This happens automatically.
1. `DriverManager` loads the drivers from the system class path.
This happens automatically.
2. The application explicitly loads the driver's class.
This is only necessary if the automatic loading (see previous item) is not available.
Expand All @@ -88,7 +89,7 @@ java\
-classpath jaybird-full-{jaybird-example-version}.jar;C:/myproject/classes\
my.company.SomeJavaExample
....
====
****

The second statement of the example tells the `java.sql.DriverManager` to open a database connection to the Firebird server running on localhost, and the path to the database is `c:/database/employee.fdb`.

Expand Down Expand Up @@ -558,6 +559,8 @@ This can be changed by the `ServerMode` setting in `firebird.conf`.
[[driver-ooremote]]
==== OOREMOTE type

[.until]_Jaybird 6_

The `OOREMOTE` type is a JDBC Type 4 specifically for use with OpenOffice.org and LibreOffice.
It addresses some differences in interpretation of the JDBC specification, and provides alternative metadata in certain cases to allow OpenOffice.org and LibreOffice to function correctly.

Expand Down
3 changes: 0 additions & 3 deletions src/docs/asciidoc/chapters/events/events.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,9 @@ Such mechanism allows Firebird to keep the event notification table very smallfo
For example, the effective size for 100 applications subscribed for 100 different events is about 40k in memory.]
and to reduce the number of messages sent to the application.

[NOTE]
====
It is not possible to pass parameters with the event, e.g. an ID of the modified records.
It is also not possible to encode such information in the event names, wildcards are not supported.
For such cases, applications should maintain a change tracking table where the IDs of the modified records are stored and the event mechanism is used to tell the application that new records were added to the table.
====

=== Posting events

Expand Down
5 changes: 1 addition & 4 deletions src/docs/asciidoc/chapters/resultsets/resultsets.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ Only rows satisfying the condition at the time of query execution are visible.
* `TYPE_SCROLL_SENSITIVE`, is not supported by Firebird and Jaybird.
Jaybird allows an application to ask for this type of result set, however in compliance with the JDBC specification, the type is "downgraded" to the `TYPE_SCROLL_INSENSITIVE` and a corresponding warning is added to the connection object.

[NOTE]
====
Due to a missing support of scrollable cursors in Firebird 4.0 and earlier, support for scrollable results set (`TYPE_SCROLL_INSENSITIVE` result set type) is implemented by fetching the complete result set to the client.
Scrolling happens in memory on the client.
This can have adverse effect on the system memory usage and performance when the result set is large.
Expand All @@ -30,7 +28,6 @@ This can have adverse effect on the system memory usage and performance when the
Starting with Firebird 5.0, server-side scrollable cursors are supported.
Jaybird 5 introduced support for scrolling non-holdable result set when the connection property `scrollableCursor` is set to value `SERVER`, and the connection is a pure Java connection (not native or embedded).
A future version may enable this behaviour by default.
====

[[resultsets-concurrency]]
==== ResultSet Concurrency
Expand Down Expand Up @@ -60,7 +57,7 @@ It is not possible to tell the server to keep a result set open over commit unle
This mode is global for the complete connection and is not suitable for holdability control on a statement level.
Use of "commit retaining" mode is believed to have an undesired side effect for read-write transactions as it inhibits garbage collection.
Because of these reasons "commit retaining" is not used in Jaybird during normal execution.
Applications are able to commit the transaction keeping the result sets open by executing a "`COMMIT RETAIN`" SQL statement.
Applications can commit the transaction keeping the result sets open by executing a "`COMMIT RETAIN`" SQL statement.

To support holdable result sets, Jaybird will upgrade the result set to `TYPE_SCROLL_INSENSITIVE` to cache all rows locally, even if you asked for a `TYPE_FORWARD_ONLY`
result set.
Expand Down
5 changes: 1 addition & 4 deletions src/docs/asciidoc/chapters/services/services.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,6 @@ This method also clears the path specified in `backupPath` property.
This method also clears the path specified in the database property.
|===

[NOTE]
====
All paths specified are paths specifications on the remote server.
This has the following implications:

Expand All @@ -223,7 +221,6 @@ This has the following implications:
. it is not possible to restore from the local or network drive unless it is mounted on the remote server.

The `FBStreamingBackupManager` can be used to perform remote backup and restore, see <<services-backup-and-restore-gbak-streaming>>.
====

After specifying all the needed properties, the application developer can use `backupDatabase()`, `backupMetadata()` and `restoreDatabase()` methods to perform the backup and restore tasks.
These methods will block until the operation is finished.
Expand Down Expand Up @@ -770,7 +767,7 @@ After this operation database can be backed up and restored to a different place

[CAUTION]
====
The presence of the checksum errors and subsequent use of `markCorruptedRecords()` method will mark all corrupted data as unused space.
The presence of checksum errors and subsequent use of `markCorruptedRecords()` method will mark all corrupted data as unused space.
You have to perform a careful check after backup/restore cycle to assess the damage.
====

Expand Down
2 changes: 1 addition & 1 deletion src/docs/asciidoc/chapters/statements/statements.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ The code below contains a short example which first performs a select to find th

[WARNING]
====
The concatenation of values into a query string as done in this example is not a good practice as it can leave your code vulnerable to SQL injection.
Concatenation of values into a query string as done in this example is not a good practice as it can leave your code vulnerable to SQL injection.
In this specific case it is safe to do as the values are integers.
In general: don't do this, use a prepared statement with parameters instead.
Expand Down
17 changes: 4 additions & 13 deletions src/docs/asciidoc/chapters/transactions/transactions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ Alternatively, you can use an external table to store the audit log.

When a connection uses explicit transaction control, each transaction must be finished by calling the `commit()` or `rollback()` methods of the `Connection` object before the connection is closed.
If a transaction was not finished, but the `close` method is called, the active transaction is rolled back automatically.
This also happens when the transaction was not finished, the connection was not closed explicitly and that `Connection` object became eligible for garbage collection.
[.until]_Jaybird 5_ In this case, the `close()` method is implicitly invoked by the class finalizer, which in turn rolls the transaction back.
This also happens when you did not commit or roll back the transaction, and did not close the connection explicitly and that `Connection` object became eligible for garbage collection.
[.until]_Jaybird 5_ In this case, the class finalizer implicitly invokes the `close()` method, which in turn rolls the transaction back.

[WARNING]
====
Expand Down Expand Up @@ -91,13 +91,10 @@ Note – Some JDBC driver implementations may also implicitly `close` the `Resul
'''
____

[NOTE]
====
[.until]_Jaybird 6_ In Jaybird 5 and earlier, in auto-commit mode a `TYPE_FORWARD_ONLY` result set was implicitly closed when `next()` returned false.
[.until]_Jaybird 6_ In Jaybird 5 and earlier, in auto-commit mode, a `TYPE_FORWARD_ONLY` result set was implicitly closed when `next()` returned false.
This was to conform to the requirements of JDBC 3.0, but since this was relaxed in JDBC 4.0 (see quote above), this behaviour was changed in Jaybird 6.

[.since]_Jaybird 6_ In auto-commit mode, a result set will now remain open until explicitly closed using `ResultSet.close()`, when any statement is executed, when the auto-commit mode is disabled, or by the close of the `Statement` or `Connection`.
====

If there is an ongoing transaction and the value of the auto-commit property is changed, the current transaction is committed.

Expand Down Expand Up @@ -233,11 +230,8 @@ Connection connection = DriverManager.getConnection(
props);
----

[NOTE]
====
The property accepts the "`short`" names as shown, or the "`long`" names with the `isc_dpb_` prefix, as defined in `org.firebirdsql.jaybird.fb.constants.TpbItems` (Jaybird 5) or `org.firebirdsql.gds.ISCConstants` (older versions).
The property accepts the "`short`" names as shown, or the "`long`" names with the `isc_dpb_` prefix, as defined in `org.firebirdsql.jaybird.fb.constants.TpbItems` (Jaybird 5 and higher) or `org.firebirdsql.gds.ISCConstants` (older versions).
For readability, we recommend using the "`short`" names.
====

The overridden mapping is used for all transactions started within the database connection.
If the default mapping is overridden via the data source configuration, it will be used for all connections created by the data source.
Expand Down Expand Up @@ -318,12 +312,9 @@ fbConnection.setTransactionParameters(tpb);

The above presents an example of populating the TPB with custom parameters.

[NOTE]
====
The constants used in the examples in this chapter were introduced in Jaybird 5.
Earlier versions have constants of the same name defined in `org.firebirdsql.gds.ISCConstants`, and similarly named constants in `org.firebirdsql.gds.TransactionParameterBuffer` (i.e. without `isc_tpb_` prefix and fully capitalized).
Those older constants will be removed in Jaybird 6 in favour of `org.firebirdsql.jaybird.fb.constants.TpbItems`.
====

==== Isolation level

Expand Down
12 changes: 6 additions & 6 deletions src/docs/asciidoc/reference/connection/firebirdautocommit.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ the auto-commit barrier will not make new committed changes visible.

This option is enabled by specifying the connection property `useFirebirdAutocommit=true`.

With this option, Jaybird will configure the transaction to use `isc_tpb_autocommit` with `autoCommit=true`.
With this option, a connection in auto-commit mode will configure the transaction to use `isc_tpb_autocommit`.
This means that Firebird server will internally commit the transaction after each statement completion.
Jaybird itself will not commit until connection close (or switching to `autoCommit=false`).
The exception is if the statement was of type `isc_info_sql_stmt_ddl`, in that case Jaybird will commit on statement success and rollback on statement failure (just like it does for all statements in normal auto commit mode).
Jaybird itself will not commit until connection close (or disabling auto-commit).
The exception is if the statement was of type `isc_info_sql_stmt_ddl`, in that case Jaybird will commit on statement success and rollback on statement failure (just like it does for all statements in normal auto-commit mode).
The reason is that Firebird for some DDL commands only executes at a real commit boundary and relying on the Firebird auto-commit is insufficient.

On statement completion (as specified in JDBC), result sets will still close unless they are holdable over commit.
The result set is only closed client side, which means that the cursor remains open server side to prevent roundtrips.
This may lead to additional resource usage server side unless explicitly closed in the code.
The result set is only closed client-side, which means that the cursor remains open server-side to prevent roundtrips.
This may lead to additional resource usage server-side unless explicitly closed in the code.
Note that any open blobs will be closed client- and server-side (until this is improved with https://github.com/FirebirdSQL/jaybird/issues/442[jaybird#442^]).

A connection can be interrogated using `FirebirdConnection.isUseFirebirdAutocommit()` if it uses `isc_tpb_autocommit`.

If you manually add `isc_tpb_autocommit` to the transaction parameter buffer and you enable this option, the `isc_tpb_autocommit` will be removed from the TPB if `autoCommit=false`.
If you manually add `isc_tpb_autocommit` to the transaction parameter buffer, and you enable this option, the `isc_tpb_autocommit` will be removed from the TPB on `setAutoCommit(false)`.

Artificial testing with repeated inserts (using a prepared statement) against a Firebird server on localhost shows that this leads to a reduction of execution time of +/- 7%.

Expand Down
16 changes: 9 additions & 7 deletions src/docs/asciidoc/reference/general/logging.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ To enable logging to the console, you can set system property `org.firebirdsql.j
[[ref-logging-custom]]
==== Custom logging implementation

[[ref-logging-custom-after-6]]
===== Custom logging in Jaybird 6 and higher

[.since]_Jaybird 6_ If you need a custom logger implementation under Jaybird 6 or higher, you will need to provide an implementation of `java.lang.System.Logger` and `java.lang.System.LoggerFinder` and a service loader definition.

Make sure you really need this: if you want to use a different logging library, it may already have the necessary implementation (for example, Log4j has the `log4j-jpl` dependency).

[[ref-logging-custom-before-6]]
===== Custom logging in Jaybird 5 and earlier
[.until]_Jaybird 6_

You can provide your own logging implementation if you don't want to use `java.util.logging` or console logging.
Expand Down Expand Up @@ -131,10 +140,3 @@ public class CustomLogger implements org.firebirdsql.logging.Logger {
On the Java command line, specify:

-Dorg.firebirdsql.jdbc.loggerImplementation=org.example.jaybird.logging.CustomLogger

[NOTE]
====
[.since]_Jaybird 6_ If you need a custom logger implementation under Jaybird 6, you will need to provide an implementation of `java.lang.System.Logger` and `java.lang.System.LoggerFinder` and a service loader definition.
Make sure you really need this: if you want to use a different logging library, it may already have the necessary implementation (for example, Log4j has the `log4j-jpl` dependency).
====
5 changes: 1 addition & 4 deletions src/docs/asciidoc/reference/statement/generatedkeys.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,12 @@ If you previously relied on absence of ANTLR to disable generated keys support,

This functionality is available for `INSERT`, `UPDATE`, `UPDATE OR INSERT` and `DELETE`, and for `MERGE` ([.since]_Firebird 3.0_).

[NOTE]
====
Generated keys retrieval modifies the statement to add a `RETURNING`-clause.
Firebird 4.0 and earlier only support `RETURNING` for DML operations that affect a single row.
Attempting to use generated keys retrieval with a statement that affects multiple rows will yield the error _"multiple rows in singleton select"_.

[.since]_Jaybird 5/Firebird 5.0_ Support for multi-row `RETURNING` is introduced in Firebird 5.0.
Support for multi-row `RETURNING` is available in Jaybird 5.
====

The examples in this section use the following (Firebird 3.0) table:

Expand Down Expand Up @@ -155,7 +152,7 @@ The values in the `int[]` parameter are the ordinal positions of the columns as
In Jaybird 3 and earlier, a null or empty array was silently ignored and the statement was executed normally (not producing generated keys).
In Jaybird 4, this behaviour has changed and instead will throw an exception with message _"Generated keys array columnIndexes was empty or null. A non-empty array is required."_
In Jaybird 3 and earlier, invalid ordinal positions are ignored and silently dropped: passing `new int[] { 1, 5, 6 }` will work, even though we don't have sixth column.
In Jaybird 3 and earlier, invalid ordinal positions are ignored and silently dropped: passing `new int[] { 1, 5, 6 }` will work, even if there is no sixth column.
In Jaybird 4, this behavior has changed and instead will throw an exception with message _"Generated keys column position <position> does not exist for table <tablename>. Check DatabaseMetaData.getColumns (column ORDINAL_POSITION) for valid values."_
====

Expand Down

0 comments on commit 7d21e6e

Please sign in to comment.