Weird Error: CLOSE BY CLIENT STACK TRACE

后端 未结 3 860
孤城傲影
孤城傲影 2020-12-29 05:11

Hi all I have a web application which use Hibernate to retrieve data in the database. And in the server side some execeptions come out at regular interval. Below is the exce

相关标签:
3条回答
  • 2020-12-29 05:42

    This is the code that triggers this log statement in C3P0:

    if ( logger.isLoggable( MLevel.FINEST ) )
      logger.log( MLevel.FINEST, this + " closed by a client.", 
                new Exception("DEBUG -- CLOSE BY CLIENT STACK TRACE") );
    

    Note that:

    1. This is not an exception, the new Exception is used merely to show execution path for debug purposes.

    2. And yes, this is only a debug message (actually, FINEST is the lowest possible level in java.util.logging).

    To wrap this up: ignore and tune your logging levels to skip these.

    0 讨论(0)
  • 2020-12-29 05:49

    I found where the error is: I think that it appears when some object calls deliberately

    com.mchange.v2.c3p0.ComboPooledDataSource.close
    

    I have configured this class in spring. When I put destroy-method="close" the error appears.

    Obviously, I've removed it and the problem is now solved.

    0 讨论(0)
  • 2020-12-29 05:56
    Hibernate connection close work like this way so you no need remove the destroy-method="close".
    
    public synchronized void close() throws SQLException
    {
      close(null);
    }
    
    private void close(Throwable cause) throws SQLException
    {
    <--statement-->
    if(cause == null)
    {
     invalidatingException = NORMAL_CLOSE_PLACEHOLDER;
     if(logger.isLoggable(MLevel.FINEST))
     logger.log(MLevel.FINEST, this + " closed by a client.", new Exception("DEBUG -- CLOSE BY CLIENT STACK TRACE"));
    <--statement-->
    }
    
    0 讨论(0)
提交回复
热议问题