Last active
April 19, 2017 09:40
-
-
Save thjanssen/5b7e27355e292f168d679e4a716e770e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Statistics stats = sessionFactory.getStatistics(); | |
long queryCount = stats.getQueryExecutionCount(); | |
long collectionFetchCount = stats.getCollectionFetchCount(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16:42:56,873 DEBUG [org.hibernate.SQL] - | |
select | |
author0_.id as id1_0_, | |
author0_.firstName as firstNam2_0_, | |
author0_.lastName as lastName3_0_, | |
author0_.version as version4_0_ | |
from | |
Author author0_ | |
where | |
author0_.id=? | |
16:42:56,926 TRACE [org.hibernate.type.descriptor.sql.BasicBinder] - binding parameter [1] as [BIGINT] - [1] | |
16:42:56,950 TRACE [org.hibernate.type.descriptor.sql.BasicExtractor] - extracted value ([id1_0_] : [BIGINT]) - [1] | |
16:42:56,965 TRACE [org.hibernate.type.descriptor.sql.BasicExtractor] - extracted value ([firstNam2_0_] : [VARCHAR]) - [Thorben] | |
16:42:56,965 TRACE [org.hibernate.type.descriptor.sql.BasicExtractor] - extracted value ([lastName3_0_] : [VARCHAR]) - [Janssen] | |
16:42:56,966 TRACE [org.hibernate.type.descriptor.sql.BasicExtractor] - extracted value ([version4_0_] : [INTEGER]) - [0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
log4j.appender.stdout=org.apache.log4j.ConsoleAppender | |
log4j.appender.stdout.Target=System.out | |
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout | |
log4j.appender.stdout.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%c] - %m%n | |
log4j.rootLogger=info, stdout | |
# basic log level for all messages | |
log4j.logger.org.hibernate=info | |
# SQL statements and parameters | |
log4j.logger.org.hibernate.SQL=debug | |
log4j.logger.org.hibernate.type.descriptor.sql=trace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | |
<persistence> | |
<persistence-unit name="my-persistence-unit"> | |
<description>Hibernate Tips</description> | |
<provider> | |
org.hibernate.jpa.HibernatePersistenceProvider | |
</provider> | |
<exclude-unlisted-classes>false</exclude-unlisted-classes> | |
<properties> | |
<property name="hibernate.format_sql" value="true" /> | |
... | |
</properties> | |
</persistence-unit> | |
</persistence> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<persistence> | |
<persistence-unit name="my-persistence-unit"> | |
<description>Hibernate Tips</description> | |
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> | |
<properties> | |
<property name="hibernate.generate_statistics" value="true" /> | |
… | |
</properties> | |
</persistence-unit> | |
</persistence> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17:34:50,353 DEBUG [org.hibernate.SQL] - select author0_.id as id1_0_, author0_.firstName as firstNam2_0_, author0_.lastName as lastName3_0_, author0_.version as version4_0_ from Author author0_ where author0_.id=1 | |
17:34:50,362 TRACE [org.hibernate.type.descriptor.sql.BasicExtractor] - extracted value ([id1_0_] : [BIGINT]) - [1] | |
17:34:50,373 TRACE [org.hibernate.type.descriptor.sql.BasicExtractor] - extracted value ([firstNam2_0_] : [VARCHAR]) - [Thorben] | |
17:34:50,373 TRACE [org.hibernate.type.descriptor.sql.BasicExtractor] - extracted value ([lastName3_0_] : [VARCHAR]) - [Janssen] | |
17:34:50,374 TRACE [org.hibernate.type.descriptor.sql.BasicExtractor] - extracted value ([version4_0_] : [INTEGER]) - [0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16:24:55,318 INFO [org.hibernate.engine.internal.StatisticalLoggingSessionEventListener] – Session Metrics { | |
25659 nanoseconds spent acquiring 1 JDBC connections; | |
22394 nanoseconds spent releasing 1 JDBC connections; | |
1091216 nanoseconds spent preparing 12 JDBC statements; | |
11118842 nanoseconds spent executing 12 JDBC statements; | |
0 nanoseconds spent executing 0 JDBC batches; | |
0 nanoseconds spent performing 0 L2C puts; | |
0 nanoseconds spent performing 0 L2C hits; | |
0 nanoseconds spent performing 0 L2C misses; | |
16999942 nanoseconds spent executing 1 flushes (flushing a total of 17 entities and 17 collections); | |
63915 nanoseconds spent executing 1 partial-flushes (flushing a total of 0 entities and 0 collections) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment