-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 13 posts ] 
Author Message
 Post subject: Hibernate, Connection pooling, and JDBC problem
PostPosted: Tue Jan 11, 2005 3:52 am 
Regular
Regular

Joined: Tue Jun 08, 2004 8:24 am
Posts: 57
I've spent a couple of months tracking down a problem in my application, and now it appears that it may be an issue between Hibernate and the pooling mechanisms.
For reference, I'm using Hibernate 2.1.7 and MySQL 4.0.18, although I've also tried numerous other versions of both.

The class HibernateSessionFilter gets instantiated as the top level filter in the chain so that it first opens a connection, and then closes that connection once the request finishes.
Code:
public class HibernateSessionFilter implements Filter {
    public void init(FilterConfig filterConfig) throws ServletException {}
    public void destroy() {}
...
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws
        IOException,
        ServletException
    {
        try {
            Session hsession = HibernateHelper.currentSession();
            hsession.setFlushMode(FlushMode.NEVER);
            // Pass control on to the next filter
            chain.doFilter(request, response);
        }
        catch (HibernateException ex) {
            throw new ServletException(ex);
        }
        finally {
            try {
                HibernateHelper.closeSession(); // THIS IS HibernateSessionFilter.java LINE 54
            }
            catch (HibernateException ex) {
                throw new ServletException(ex);
            }
        }
    }
...
}

It accomplishes this through HibernateHelper, which uses ThreadLocal to keep things thread-safe:
Code:
public class HibernateHelper {
    static SessionFactory sessionFactory;
    static final ThreadLocal session = new ThreadLocal();
...
    public static SessionFactory getSessionFactory() {
        if(sessionFactory == null) {
            try {
                sessionFactory = new Configuration().configure().buildSessionFactory();
            } catch (HibernateException ex) {
                throw new RuntimeException("Hibernate Configuration problem: " + ex.getMessage(), ex);
            }           
        }
        return sessionFactory;
    }
...
    public static Session currentSession() throws HibernateException {
        Session s = (Session) session.get();
        // Open a new Session, if this Thread has none yet
        if (s == null) {
            s = getSessionFactory().openSession();
            session.set(s);
        }
        return s;
    }

    public static void closeSession() throws HibernateException {
        Session s = (Session) session.get();
        session.set(null);
        if (s != null && s.isOpen())
            s.close(); // THIS IS HibernateHelper.java LINE 53
    }
}


The application itself runs fine for awhile, but after a number of hours, it begins to intermittantly throw exceptions:

net.sf.hibernate.exception.GenericJDBCException: Cannot close connection
at net.sf.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:90)
at net.sf.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:79)
at net.sf.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:30)
at net.sf.hibernate.impl.BatcherImpl.convert(BatcherImpl.java:325)
at net.sf.hibernate.impl.BatcherImpl.closeConnection(BatcherImpl.java:311)
at net.sf.hibernate.impl.SessionImpl.disconnect(SessionImpl.java:3387)
at net.sf.hibernate.impl.SessionImpl.close(SessionImpl.java:584)
at com.somewhere.application.data.HibernateHelper.closeSession(HibernateHelper.java:53)
at com.somewhere.application.data.HibernateSessionFilter.doFilter(HibernateSessionFilter.java:54)
...
Caused by: java.sql.SQLException: No operations allowed after connection closed.


HibernateHelper.java:53 and HibernateSessionFilter.java:54 are marked in the above code snippets.

According to the JDNI datasource HOWTO for Tomcat5, exceptions on close should always be caught and swallowed.

From http://jakarta.apache.org/tomcat/tomcat ... 20Problems
Code:
  Connection conn = null;
  Statement stmt = null;  // Or PreparedStatement if needed
  ResultSet rs = null;
  try {
    conn = ... get connection from connection pool ...
    stmt = conn.createStatement("select ...");
    rs = stmt.executeQuery();
    ... iterate through the result set ...
    rs.close();
    rs = null;
    stmt.close();
    stmt = null;
    conn.close(); // Return to connection pool
    conn = null;  // Make sure we don't close it twice
  } catch (SQLException e) {
    ... deal with errors ...
  } finally {
    // Always make sure result sets and statements are closed,
    // and the connection is returned to the pool
    if (rs != null) {
      try { rs.close(); } catch (SQLException e) { ; }
      rs = null;
    }
    if (stmt != null) {
      try { stmt.close(); } catch (SQLException e) { ; }
      stmt = null;
    }
    if (conn != null) {
      try { conn.close(); } catch (SQLException e) { ; }
      conn = null;
    }
  }



However, Hibernate doesn't seem to do this, as can be seen by following the stack trace.

The important code within Hibernate itself goes like this:
Code:
BatcherImpl.java:
   public void closeConnection(Connection conn) throws HibernateException {
      try {
         if ( !conn.isClosed() ) {
            try {
               JDBCExceptionReporter.logWarnings( conn.getWarnings() );
               conn.clearWarnings();
            }
            catch (SQLException sqle) {
               //workaround for WebLogic
               log.debug("could not log warnings", sqle);
            }
         }
         factory.getConnectionProvider().closeConnection(conn);
      }
      catch (SQLException sqle) {
         throw convert( sqle, "Cannot close connection" );
      }
   }

In the case of C3P0, getConnectionProvider().closeConnection() looks like this:
Code:
public class C3P0ConnectionProvider implements ConnectionProvider {
...
    public void closeConnection(Connection conn) throws SQLException {
      conn.close();
   }
...
}

And DBCP:
Code:
public class DBCPConnectionProvider implements ConnectionProvider {
...
    public void closeConnection(Connection conn) throws SQLException {
      conn.close();
   }
...
}

Both C3P0 and DBCP exhibit this behavior.


I'm not sure where to stand on this issue.

In this case, I've managed to track the root cause of the exception to the new mysql jdbc driver, which after version 3.0.9 no longer checks the connection status prior to executing operations upon it (apparently to bring the driver in line with the spec).
The answer is supposed to be to change the connection pool settings to retire a connection before the MySQL timeout (default 8 hours), but I've tried this and it doesn't work.
But I digress...

If exceptions are simply swallowed and ignored when they occur (as suggested by the Tomcat people), doesn't this cause a bad connection to be returned to the connection pool? I do notice that if I let the application run in this bad state for long enough, the pool will eventually stop giving out connections.

I could of course simply swallow exceptions at the HibernateHelper level, but this is for a production system, and I don't want to do something akin to taping the needle on a boiler because the safety systems keep going off.


Which is the correct way to handle this?
For now I can of course just switch back to MySQL driver 3.0.9, but it doesn't give me a warm fuzzy feeling not being able to upgrade the driver, or knowing that any other JDBC issue could bring me right back to this problem again.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 12, 2005 11:53 pm 
Beginner
Beginner

Joined: Tue Sep 02, 2003 3:25 pm
Posts: 21
Location: Kingston Jamaica, West Indies
I think i have the same problem but in WAS 5.1 and DB2 after a couple hours the server responses slowly and has exceeded the number of connection. I am told this has to do with run away agents.

What the hell is hibernate doing.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 13, 2005 3:35 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
Quote:
What the hell is hibernate doing.

i think you should look better at your technical architecture and parameters.

Most of the users use C3P0 when they don't use datasources.
I use c3p0 and have run stress test with more than 200 concurrent db connection.... nothing in the stacjtrace about : Cannot close connection

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 13, 2005 10:53 am 
Newbie

Joined: Thu Jan 13, 2005 10:04 am
Posts: 18
This sounds similar to a problem in an article on theserverside (9.4.1 Pitfall tip #1: Check the firewall) :

http://www.theserverside.com/articles/c ... pter_9.pdf

"...After a few hours, some idle connections started getting timedout by the database server. Therefore, the application database connection pool began dropping connections but held on to the stale connection objects.
...
As the first users logged in during the early hours of the morning, the database connection threw a SQLException. The exception was thrown because an attempt was made to execute a SQL query using a stale connection. When the application connection pool received the exception, it attempted to refresh the whole pool.
...
The firewall turned out to be the culprit, because it was configured to keep connections alive for a longer duration of time."


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 13, 2005 11:57 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
"Caused by: java.sql.SQLException: No operations allowed after connection closed"
It says connection is closed twice. I do not see stack trace, but probably you close connection before filter tries to do the same. It is not related to hibernate code.
Try to fix your code this way first:
http://forum.hibernate.org/viewtopic.php?t=936790


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 13, 2005 9:08 pm 
Regular
Regular

Joined: Tue Jun 08, 2004 8:24 am
Posts: 57
Quote:
i think you should look better at your technical architecture and parameters.

Most of the users use C3P0 when they don't use datasources.
I use c3p0 and have run stress test with more than 200 concurrent db connection.... nothing in the stacjtrace about : Cannot close connection


I've used C3P0 as well with the same results as DBCP.
You can't reproduce the problem in a short period of time (like the 200 concurrent db connection stress test) unless you set the MySQL timeout to a REALLY short value (I've set it to 5 seconds and even then it's not sure to surface in a short term stress test.. maybe only 1 out of 100-200 accesses fails).

I've been through the documents back and forth many times for Hibernate, Mysql, DBCP, and C3P0. There is mention of this problem on pretty much every forum, but everyone always blames it on some other part (hibernate blames dbcp, dbcp blames mysql, mysql blames hibernate/c3p0 etc).

Quote:
"Caused by: java.sql.SQLException: No operations allowed after connection closed"
It says connection is closed twice. I do not see stack trace, but probably you close connection before filter tries to do the same. It is not related to hibernate code.


I am not closing the connection twice. I have been through my code with a fine-toothed comb. Even a grep only shows one line with the characters "close()" in it, and that's in the hibernate filter, which sits at the top of the filter chain.
The architecture of the application ensures that the connection is opened before processing, and closed after processing, so there's no need for me to manually close it in the code itself. The rest of the stack trace above what I showed is just the standard Tomcat stack trace.

The HibernateHelper code:

Code:
    private static final ThreadLocal session = new ThreadLocal();

    public static Session currentSession() throws HibernateException {
        Session s = (Session) session.get();
        // Open a new Session, if this Thread has none yet
        if (s == null) {
            s = getSessionFactory().openSession();
            session.set(s);
        }
        return s;
    }

    public static void closeSession() throws HibernateException {
        Session s = (Session) session.get();
        session.set(null);
        if (s != null && s.isOpen())
            s.close();
    }


HibernateHelper clears the reference to the hibernate session before closing it, so successive calls to close can never call close on the same hibernate session.
It is also checking to see if the hibernate session is open before attempting to close. If a call to Hibernate's Session.isOpen() returns true, shouldn't a Session.close() succeed without throwing an "already closed" exception?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 13, 2005 10:37 pm 
Regular
Regular

Joined: Tue Jun 08, 2004 8:24 am
Posts: 57
I just got another exception thrown a short while ago.
This is while using c3p0 as the pooling mechanism, but it does pretty much the same thing under DBCP.

This is a full stack trace this time:

2005-01-14 06:42:54,638 [TP-Processor3] ERROR net.sf.hibernate.util.JDBCExceptionReporter - No operations allowed after connection closed.

Connection was closed due to the following exception:

** BEGIN NESTED EXCEPTION **

java.sql.SQLException
MESSAGE: Communication link failure: java.io.IOException, underlying cause: Unexpected end of input stream

** BEGIN NESTED EXCEPTION **

java.io.IOException
MESSAGE: Unexpected end of input stream

STACKTRACE:

java.io.IOException: Unexpected end of input stream
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1405)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1775)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1020)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1109)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2030)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1563)
at com.mchange.v2.sql.filter.FilterPreparedStatement.executeQuery(FilterPreparedStatement.java:68)
at com.mchange.v2.c3p0.impl.C3P0PooledConnection$2.executeQuery(C3P0PooledConnection.java:567)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:88)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:875)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:269)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:911)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:931)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:59)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:51)
at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:415)
at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2130)
at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:2000)
at net.sf.hibernate.impl.SessionImpl.load(SessionImpl.java:1929)
at com.something.application.data.HibernateHelper.load(HibernateHelper.java:61)
at com.something.application.data.FreeInputPagePersistence.getPageById(FreeInputPagePersistence.java:205)
at com.something.application.event.restaurant.FreeInputPageEvents.viewPage(FreeInputPageEvents.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.something.common.webapp.RequestEvent.execute(RequestEvent.java:79)
at com.something.common.webapp.ControllerServlet.doGet(ControllerServlet.java:93)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.application.RestaurantIdFilter.doFilter(RestaurantIdFilter.java:83)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.common.webapp.MultiSearchAndReplaceFilter.doFilter(MultiSearchAndReplaceFilter.java:71)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.application.data.HibernateSessionFilter.doFilter(HibernateSessionFilter.java:46)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.application.EncodingFilter.doFilter(EncodingFilter.java:56)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.application.LocaleFilter.doFilter(LocaleFilter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.common.idx.webapp.CarrierFilter.doFilter(CarrierFilter.java:42)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.common.idx.webapp.CarrierFilter.doFilter(CarrierFilter.java:42)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.common.webapp.PathFilter.doFilter(PathFilter.java:57)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.common.webapp.PathFilter.doFilter(PathFilter.java:49)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.common.util.IdentifierFilter.doFilter(IdentifierFilter.java:103)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:211)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:309)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:387)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:673)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:615)
at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:786)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
at java.lang.Thread.run(Thread.java:534)


** END NESTED EXCEPTION **



STACKTRACE:

java.sql.SQLException: Communication link failure: java.io.IOException, underlying cause: Unexpected end of input stream

** BEGIN NESTED EXCEPTION **

java.io.IOException
MESSAGE: Unexpected end of input stream

STACKTRACE:

java.io.IOException: Unexpected end of input stream
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1405)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1775)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1020)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1109)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2030)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1563)
at com.mchange.v2.sql.filter.FilterPreparedStatement.executeQuery(FilterPreparedStatement.java:68)
at com.mchange.v2.c3p0.impl.C3P0PooledConnection$2.executeQuery(C3P0PooledConnection.java:567)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:88)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:875)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:269)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:911)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:931)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:59)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:51)
at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:415)
at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2130)
at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:2000)
at net.sf.hibernate.impl.SessionImpl.load(SessionImpl.java:1929)
at com.something.application.data.HibernateHelper.load(HibernateHelper.java:61)
at com.something.application.data.FreeInputPagePersistence.getPageById(FreeInputPagePersistence.java:205)
at com.something.application.event.restaurant.FreeInputPageEvents.viewPage(FreeInputPageEvents.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.something.common.webapp.RequestEvent.execute(RequestEvent.java:79)
at com.something.common.webapp.ControllerServlet.doGet(ControllerServlet.java:93)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.application.RestaurantIdFilter.doFilter(RestaurantIdFilter.java:83)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.common.webapp.MultiSearchAndReplaceFilter.doFilter(MultiSearchAndReplaceFilter.java:71)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.application.data.HibernateSessionFilter.doFilter(HibernateSessionFilter.java:46)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.application.EncodingFilter.doFilter(EncodingFilter.java:56)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.application.LocaleFilter.doFilter(LocaleFilter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.common.idx.webapp.CarrierFilter.doFilter(CarrierFilter.java:42)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.common.idx.webapp.CarrierFilter.doFilter(CarrierFilter.java:42)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.common.webapp.PathFilter.doFilter(PathFilter.java:57)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.common.webapp.PathFilter.doFilter(PathFilter.java:49)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.common.util.IdentifierFilter.doFilter(IdentifierFilter.java:103)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:211)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:309)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:387)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:673)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:615)
at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:786)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
at java.lang.Thread.run(Thread.java:534)


** END NESTED EXCEPTION **


at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1527)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1775)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1020)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1109)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2030)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1563)
at com.mchange.v2.sql.filter.FilterPreparedStatement.executeQuery(FilterPreparedStatement.java:68)
at com.mchange.v2.c3p0.impl.C3P0PooledConnection$2.executeQuery(C3P0PooledConnection.java:567)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:88)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:875)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:269)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:911)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:931)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:59)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:51)
at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:415)
at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2130)
at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:2000)
at net.sf.hibernate.impl.SessionImpl.load(SessionImpl.java:1929)
at com.something.application.data.HibernateHelper.load(HibernateHelper.java:61)
at com.something.application.data.FreeInputPagePersistence.getPageById(FreeInputPagePersistence.java:205)
at com.something.application.event.restaurant.FreeInputPageEvents.viewPage(FreeInputPageEvents.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.something.common.webapp.RequestEvent.execute(RequestEvent.java:79)
at com.something.common.webapp.ControllerServlet.doGet(ControllerServlet.java:93)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.application.RestaurantIdFilter.doFilter(RestaurantIdFilter.java:83)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.common.webapp.MultiSearchAndReplaceFilter.doFilter(MultiSearchAndReplaceFilter.java:71)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.application.data.HibernateSessionFilter.doFilter(HibernateSessionFilter.java:46)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.application.EncodingFilter.doFilter(EncodingFilter.java:56)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.application.LocaleFilter.doFilter(LocaleFilter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.common.idx.webapp.CarrierFilter.doFilter(CarrierFilter.java:42)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.common.idx.webapp.CarrierFilter.doFilter(CarrierFilter.java:42)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.common.webapp.PathFilter.doFilter(PathFilter.java:57)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.common.webapp.PathFilter.doFilter(PathFilter.java:49)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.something.common.util.IdentifierFilter.doFilter(IdentifierFilter.java:103)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:211)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:309)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:387)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:673)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:615)
at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:786)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
at java.lang.Thread.run(Thread.java:534)


** END NESTED EXCEPTION **


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 14, 2005 2:45 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
It can be caused by connection timeaout, try to dissable pooling "maxConnections = 0" on most pools can do it. Connection pooling must be a minor optimization on MySQL (you do not need connection speed if your connections can timeout anyway). Try some next configuration workaround if it does not help, there are many workarounds to solve this "problem", search this forum.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 14, 2005 3:18 am 
Regular
Regular

Joined: Tue Jun 08, 2004 8:24 am
Posts: 57
Quote:
It can be caused by connection timeaout, try to dissable pooling "maxConnections = 0" on most pools can do it. Connection pooling must be a minor optimization on MySQL

This is a system in testing at the moment, and will eventually be replacing another system that gets 800,000 to 1,000,000 hits a day.
If I disable connection pooling, won't the application break as soon as I switch it over to live?

In my original post, I already said that this is a timeout issue. My question was what to do about it, since as a result, a stale connection seems to be hanging around in the connection pool (doesn't matter which one), and then I get an "already closed" error when trying to close a hibernate session even though a call to isOpen() returned true.

Quote:
(you do not need connection speed if your connections can timeout anyway).

This is not just a timeout issue.. It is potentially a network issue as well. If something else such as a bad cable or router causes connections to drop, I'll be in the same boat, with a connection pool full of stale connections.

Quote:
Try some next configuration workaround if it does not help, there are many workarounds to solve this "problem", search this forum.

I'm currently using the only workaround that actually works (for now), which is to use an old version of the MySQL driver. This is at best a temporary fix.
I posted this question to the list because I've exhausted the other posibilities and I was hoping someone could help with this.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 14, 2005 4:29 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Probably old driver has reconnect "feature", pools can be configured this way too. But this is not a good workaround, probably MySQL dropped it for this reason.
Stress application without pool, I found it is the most stable deployment in most cases (maxRequests < maxConnections), if you open single lazzy connection per request then connection startup overhead on MySQL must be very trivial. I am not sure about MySQL, but I do not use pools for PostreSQL(MySQL connection startup must be faster in theory). Pools have meaning for databases configured with complex authentication or for very slow connection.
You do not need to trust me, just test it.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 26, 2005 8:22 pm 
Regular
Regular

Joined: Tue Jun 08, 2004 8:24 am
Posts: 57
After a bit of work, I finally figured out how to solve the problem.

I made a change to HibernateHelper so that it handles the connection pool and passes in an already open connection to Hibernate's createSession().
Once the request is finished, I close the session and then close the connection as the last act of my filter.

So it would seem that Hibernate was the culprit, after all. By passing in an already open connection to Hibernate, I can use DBCP, c3p0, or just raw connections and it works perfectly now.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 19, 2005 10:10 am 
Beginner
Beginner

Joined: Wed May 05, 2004 3:26 am
Posts: 25
Its been a long time but Ill give it a shot.

mock1010, care to elaborate more on this please? (probably with some code).

thanks in advance.

_________________
The Bits Control The Atoms


Top
 Profile  
 
 Post subject: Re: Hibernate, Connection pooling, and JDBC problem
PostPosted: Sun Jul 17, 2011 10:28 am 
Newbie

Joined: Sun Jul 17, 2011 10:16 am
Posts: 1
hi,

can you please give me the suggestion which am getting at production and dev environments, am opening and closing the session every request, i don't know where am wrong.

1509 [http-8486-5] ERROR org.hibernate.util.JDBCExceptionReporter - Deadlock found when trying to get lock; try restarting transaction
1509 [http-8486-5] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session
org.hibernate.exception.LockAcquisitionException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:82)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:253)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:92)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:87)
at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:222)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2359)
at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2312)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2612)
at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:96)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:606)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:709)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:678)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.test.audit.aop.interceptor.AuditAdvice.invoke(AuditAdvice.java:136)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.test.caching.support.OsCacheInvalidatorInterceptor.invoke(OsCacheInvalidatorInterceptor.java:94)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:50)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.test.framework.aop.interceptor.ServiceEntitlementInterceptor.invoke(ServiceEntitlementInterceptor.java:73)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.test.framework.aop.interceptor.CustomValidationAdvice.invoke(CustomValidationAdvice.java:69)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.test.framework.aop.interceptor.ValidationAdvice.invoke(ValidationAdvice.java:84)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.test.framework.aop.interceptor.FirmBoundaryAdvice.invoke(FirmBoundaryAdvice.java:118)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.test.framework.aop.interceptor.ExceptionLoggingAdvice.invoke(ExceptionLoggingAdvice.java:40)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy6.updateAndLog(Unknown Source)
at com.test.cs.security.authentication.impl.AuthenticationServiceImpl.updateAndLog(AuthenticationServiceImpl.java:584)
at com.test.cs.security.authentication.impl.AuthenticationServiceImpl.createSession(AuthenticationServiceImpl.java:412)
at com.test.cs.security.authentication.impl.AuthenticationServiceImpl.login(AuthenticationServiceImpl.java:132)
at com.test.cs.security.authentication.impl.AuthenticationServiceImpl.login(AuthenticationServiceImpl.java:115)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)
at $Proxy25.login(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.test.caching.support.CsaOsCacheInvalidatorInterceptor.invoke(CsaOsCacheInvalidatorInterceptor.java:94)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.test.framework.aop.interceptor.ServiceEntitlementInterceptor.invoke(ServiceEntitlementInterceptor.java:73)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.test.framework.aop.interceptor.ExceptionLoggingAdvice.invoke(ExceptionLoggingAdvice.java:40)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy26.login(Unknown Source)
at com.test.cs.admin.webservice.impl.AdminWebServiceImpl.performLogin(AdminWebServiceImpl.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at com.test.framework.aop.interceptor.WSManagerAdvice.proceed(WSManagerAdvice.java:54)
at com.test.framework.aop.interceptor.WSManagerAdvice.invoke(WSManagerAdvice.java:37)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy63.performLogin(Unknown Source)
at com.test.cs.security.wssecurity.PasswordHandler.handle(PasswordHandler.java:26)
at org.apache.ws.security.processor.UsernameTokenProcessor.handleUsernameToken(UsernameTokenProcessor.java:128)
at org.apache.ws.security.processor.UsernameTokenProcessor.handleToken(UsernameTokenProcessor.java:49)
at org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:279)
at org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:201)
at org.codehaus.xfire.security.wss4j.WSS4JInHandler.invoke(WSS4JInHandler.java:139)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.transport.DefaultEndpoint.onReceive(DefaultEndpoint.java:64)
at org.codehaus.xfire.transport.AbstractChannel.receive(AbstractChannel.java:38)
at org.codehaus.xfire.transport.http.XFireServletController.invoke(XFireServletController.java:304)
at org.codehaus.xfire.transport.http.XFireServletController.doService(XFireServletController.java:129)
at org.codehaus.xfire.spring.remoting.XFireServletControllerAdapter.handleRequest(XFireServletControllerAdapter.java:67)
at org.codehaus.xfire.spring.remoting.XFireExporter.handleRequest(XFireExporter.java:48)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.test.framework.controller.FirmFilter.doFilter(FirmFilter.java:142)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.test.framework.controller.FirmURIFilter.doFilter(FirmURIFilter.java:42)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.test.framework.controller.FirmURIFilter.doFilter(FirmURIFilter.java:46)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.sql.BatchUpdateException: Deadlock found when trying to get lock; try restarting transaction
at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:652)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)
... 129 more



and Hi mock1010,

can you please elaborate your problem with some code that may be very helpful to me. please am new to hibernate.

Thanks,
Gangadhar


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 13 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.