Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 107391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:44:48+00:00 2026-05-11T01:44:48+00:00

I have been using Hibernate very successfully, but today I noticed a bizarre phenomenon

  • 0

I have been using Hibernate very successfully, but today I noticed a bizarre phenomenon to do with logging. If I turn on logging (at a ‘debug’ level) for the classes underneath org.hibernate (for instance org.hibernate.SQL or org.hibernate.impl.SessionImpl), I get twice each log line corresponding to those classes. I never see that with logging any other package.

Here’s an excerpt from a log output. The first and fourth lines are mine, the others are Hibernate’s:

23:54:45,472 TRACE UserDaoImpl:37 - Loading User by id: 2 23:54:45,473 DEBUG SQL:401 - select user0_.id as id22_2_, user0_.avatar as avatar22_2_, ... 23:54:45,473 DEBUG SQL:401 - select user0_.id as id22_2_, user0_.avatar as avatar22_2_, ... 23:54:45,499 TRACE PropertyDaoImpl:40 - Loading class com.myapp.locale.Region with ID 21 23:54:45,503 DEBUG SQL:401 - select region0_.id as id19_1_, region0_.code as code19_1_, ... 23:54:45,503 DEBUG SQL:401 - select region0_.id as id19_1_, region0_.code as code19_1_, ... 

Evidence from the side of the database shows that the commands are sent only once each (fortunately!).

I use Hibernate-Annotations 3.3.1.GA
with the PostgreSQL JDBC connector 5.0.7
and log4j 1.2.14

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T01:44:48+00:00Added an answer on May 11, 2026 at 1:44 am

    All I can think of:

    1. Check that your log4j config doesn’t have multiple appenders defined at different levels? If you have your appender attached to the org.hibernate logger, and attached again to the org.hibernate.SQL logger, then you’ll see this twice (unless you turn off additivity for the lower-level logger).
    2. You don’t have the hibernate.show_sql property set on your SessionFactory? That doesn’t enable logging to log4j (you do that through log4j config), it just dumps to the console. If your log4j is dumping to the console too you’ll see it twice. However, that looks like a log4j format log line, not the console dumps done by hibernate, so that seems unlikely. Worth mentioning though.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been using Hibernate for years and never have a problem with it, but
I've been using Hibernate for a few years but have only used it with
I have been using the CodeIgniter system for a while now - but it
I have been using SQL Compare by Redgate at my company and was very
I have not been using envers for very long, and i have hit a
I have been using Hibernate ORM, which is an implementation of the JPA specification
I have been using Hibernate/Spring. I have a small doubt. If we get 1000
I have been using Hibernate Restrictions in JPA 1.0 ( Hibernate driver ). There
I have been using Hibernate + HSQLDB on my desktop for developing a database
I'm using Hibernate with Spring in my application. I have been consistently using detached

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.