Sripathi Acharya
Sripathi Acharya

Reputation: 83

WebLogic - Turning off Hibernate log from server out

I am getting annoying logs in the weblogic server logs whenever a query fails to update the record due to row level locking in the table. The locking is expected as multiple application will try to update the record at same time. The application is designed to handle these exceptions and retry after an interval. But the Hibernate writes the error logs to server out files every time the query fails.

WARNING: SQL Error: -244, SQLState: IX000
16-Oct-2013 19:15:00 org.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: Could not do a physical-order read to fetch next row.
16-Oct-2013 19:15:00 org.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: -113, SQLState: IX000
16-Oct-2013 19:15:00 org.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: ISAM error: the file is locked.
16-Oct-2013 19:15:00 org.hibernate.event.def.AbstractFlushingEventListener performExecutions
SEVERE: Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: could not update: [uk.co.orange.rp.collections.entity.PpsServerLock#2]
        at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
        .
        .
        .

In Eclipse, I am able to avoid logging on the console by adding slf4j-log4j12 jar in the classpath. But I am not able to achieve the same in WebLogic application.

Even tried by adding the following on weblogic-application.xml, no luck.

<prefer-application-packages>
    <package-name>org.slf4j.*</package-name>
    <package-name>org.apache.log4j.*</package-name>
</prefer-application-packages>

Can someone suggest what else can be done.

I am using Hibernate-3.3.2, Log4j-1.2.15, slf4j-1.5.6, JPA-1.1

Regards

Upvotes: 0

Views: 1872

Answers (2)

Sripathi Acharya
Sripathi Acharya

Reputation: 83

I found the reason, I had both slf4j-log4j and slf4j-jdk14 jars in the server classpath. I've removed the slf4j-jdk14 from classpath and everything worked as expected. Since I didn't wanted any hibernate logs, no changes were required for the log4j.xml.

Thanks All.

Upvotes: 0

Shailendra
Shailendra

Reputation: 9102

As you mentioned that you are using sl4j as the logging facade and log4j as the underlying logging library, you must be using application specific log4j properties (or xml config) file somewhere in your application classpath. Try setting the log4j logger for org.hibernate to FATAL or to level greater than whatever level you are catching exception in your application code.

Upvotes: 0

Related Questions