Skip to content

Commit cb6b019

Browse files
committed
document log category org.hibernate.orm.jdbc.batch in Short Guide
1 parent 21b138c commit cb6b019

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

documentation/src/main/asciidoc/introduction/Configuration.adoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ These settings really help when troubleshooting the generated SQL statements.
490490
| `hibernate.highlight_sql` | If `true`, log SQL with syntax highlighting via ANSI escape codes
491491
|===
492492

493-
Alternatively, you can enable debug-level logging for the category `org.hibernate.SQL` using your preferred SLF4J logging implementation.
493+
Alternatively, you can enable ``DEBUG``-level logging for the category `org.hibernate.SQL` using your preferred SLF4J logging implementation.
494494

495495
For example, if you're using Log4J 2 (as above in <<optional-dependencies>>), add these lines to your `log4j2.properties` file:
496496

@@ -507,6 +507,9 @@ logger.jdbc-bind.level=trace
507507
logger.jdbc-extract.name=org.hibernate.orm.jdbc.extract
508508
logger.jdbc-extract.level=trace
509509
510+
# JDBC batching
511+
logger.jdbc-batch.name=org.hibernate.orm.jdbc.batch
512+
logger.jdbc-batch.level=trace
510513
----
511514

512515
SQL logging respects the settings `hibernate.format_sql` and `hibernate.highlight_sql`, so we don't miss out on the pretty formatting and highlighting.

documentation/src/main/asciidoc/introduction/Tuning.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ All we need to do is set a single property:
141141
| link:{doc-javadoc-url}/org/hibernate/cfg/BatchSettings.html#STATEMENT_BATCH_SIZE[`hibernate.jdbc.batch_size`] | Maximum batch size for SQL statement batching | `setJdbcBatchSize()`
142142
|===
143143

144+
To confirm that statement batching is working, enable ``TRACE``-level logging for the category `org.hibernate.orm.jdbc.batch`.
145+
144146
That said, batching is rarely the most convenient or most efficient way to update or delete many rows at once.
145147

146148
[TIP]

0 commit comments

Comments
 (0)