Announcement Announcement Module
Collapse
No announcement yet.
Spring MVC + Hibernate web application. Web server hangs on load of CRUD operations Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring MVC + Hibernate web application. Web server hangs on load of CRUD operations

    I am working on the following project and have came across a runtime issue.

    http://github.com/dmcquillan314/YouthMinistryHibernate

    The instructions to run this project are located in the README.md file although it looks a little messy at the moment. Just view the raw version and it should be readable. Once those steps are completed you should have the environment running.

    The issue is on the admin page which is located at:

    Code:
    http://localhost:portno/admin
    All accounts are currently being added with a role of admin for testing purposes.

    As for steps to recreate the issue see the following:

    1. Signup for a user account it will automatically get the ROLE_ADMIN and ROLE_USER user roles.

    2. Navigate the the /admin url

    3. Add a few groups using the group manager

    4. Attempt to add a text entry and it should freeze up I noticed I didn't see any traffic when i set a breakpoint either which is strange..

    5. If you aren't able to recreate this "freezing" right away then keep trying to create and update different assets it seems to be the page content and events in particular. For now all the controllers are located in the admin controller class until I move them to different controllers.

    I've tried several things already to try and fix it such as changing setting around on the session timeout of my db connection pool as well as on hibernate.

    I've also tried to set some breakpoints in hopes of seeing where the application freezes however it never seems to get to the breakpoint in the AdminController class that I have set when the error occurs.

    The logs are somewhat unhelpful as well here's the last few lines from an instance where it fails:

    Code:
        16:32:19.061 [tomcat-http--13] DEBUG o.s.security.web.FilterChainProxy - /admin/createtextentry reached end of additional filter chain; proceeding with original chain
            16:32:19.061 [tomcat-http--13] DEBUG o.s.web.servlet.DispatcherServlet - DispatcherServlet with name 'appServlet' processing POST request for [/YouthMinistryHibernate/admin/createtextentry]
            16:32:19.061 [tomcat-http--13] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Looking up handler method for path /admin/createtextentry
            16:32:19.062 [tomcat-http--13] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Returning handler method [public java.lang.String com.youthministry.controller.AdminController.handleCreateTextEntry(com.youthministry.domain.TextEntry,org.springframework.validation.BindingResult,org.springframework.ui.Model)]
            16:32:19.062 [tomcat-http--13] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'adminController'
            16:32:19.063 [tomcat-http--13] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'txManager'
            16:32:19.063 [tomcat-http--13] DEBUG o.s.o.h.HibernateTransactionManager - Creating new transaction with name [com.youthministry.service.impl.GroupServiceImpl.getGroupById]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT,readOnly; ''
            16:32:19.063 [tomcat-http--13] DEBUG o.s.o.h.HibernateTransactionManager - Opened new Session [SessionImpl(PersistenceContext[entityKeys=[],collectionKeys=[]];ActionQueue[insertions=[] updates=[] deletions=[] collectionCreations=[] collectionRemovals=[] collectionUpdates=[] unresolvedInsertDependencies=UnresolvedEntityInsertActions[]])] for Hibernate transaction
            16:32:19.063 [tomcat-http--13] DEBUG o.s.o.h.HibernateTransactionManager - Preparing JDBC Connection of Hibernate Session [SessionImpl(PersistenceContext[entityKeys=[],collectionKeys=[]];ActionQueue[insertions=[] updates=[] deletions=[] collectionCreations=[] collectionRemovals=[] collectionUpdates=[] unresolvedInsertDependencies=UnresolvedEntityInsertActions[]])]
            16:32:19.063 [tomcat-http--13] DEBUG o.s.jdbc.datasource.DataSourceUtils - Setting JDBC   Connection [[email protected]dd92714[valid=true]] read-only
    So far I have learned that it is not a deadlock via my database but rather a deadlock in spring somewhere around the DataSourceUtils when trying to access the Connection ProxyHandler as shown above in the server logs as the last long entry.

    I have also found that the issue lies somewhere in the spring classes. I believe the two that may be causing the issue are:
    Code:
    org.springframework.jdbc.datasource.DataSourceUtils
    Code:
    org.springframework.orm.hibernate4.HibernateTransactionManager
    I am using Spring 3.2.3.RELEASE, Hibernate 4.1 and DBCP as my connection pool.

    Any help is greatly appreciated I've been struggling with this issue for a week or so now. Thanks in advance.
    Last edited by dmcquillan314; May 28th, 2013, 12:42 AM.

  • #2
    I've also posted this on the stack overflow and hibernate forums as well. See links below:

    http://stackoverflow.com/questions/1...f-crud-operati

    https://forum.hibernate.org/viewtopi...026392&start=0

    The comments on the stack overflow post might give some insight as to what I've already tried as possible fixes.

    Comment

    Working...
    X