File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Hibernate transaction begin stuck Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate transaction begin stuck" Watch "Hibernate transaction begin stuck" New topic
Author

Hibernate transaction begin stuck

avseq anthoy
Ranch Hand

Joined: Apr 27, 2004
Posts: 104
Dear all
In my web application , I write a hibernate transaction filter as below


There is a frame in the jsp page as below


When client enter into the jsp page.
The server side receives leftFrame http request and rightFrame http request almost simultaneously.But one request will be stuck in the tx.begin(); until the anther request had been completed and commited. But I think both request should proceed simultaneously.
Can someone tell me why the phenomenon occur?
I deploy the web application on Tomcat. My hibernate setting as below



My Way,My Pace
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

What database are you using? And what transaction isolation level do you use?

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Arun Kumarr
Ranch Hand

Joined: May 16, 2005
Posts: 513

Can you post the hibernate logs?


If you are not laughing at yourself, then you just didn't get the joke.
avseq anthoy
Ranch Hand

Joined: Apr 27, 2004
Posts: 104
Thanks for your reply
I use Oracle 10G, and I didn't specify any isolation level in my application.
So I think the isolation level is default in the Hibernate.

I try to print the Hibernate log using the following log4j.properties


But it only shows Spring framework's log. I can't see any logs about Hibernate.
Are there any wrong with my configuration?
Arun Kumarr
Ranch Hand

Joined: May 16, 2005
Posts: 513

I'll rephrase. Can you post your application log file entries.
avseq anthoy
Ranch Hand

Joined: Apr 27, 2004
Posts: 104
Arun Kumarr wrote:I'll rephrase. Can you post your application log file entries.

Thanks for your prompt reply.But I can't get your point.
Does the application log file entries meaning the log that I tested only Spring framework's log?
Here is the log as below(I eliminate the logs that produced by my applcation because it is not English):
Arun Kumarr
Ranch Hand

Joined: May 16, 2005
Posts: 513

But one request will be stuck in the tx.begin(); until the anther request had been completed and commited. But I think both request should proceed simultaneously.
Can someone tell me why the phenomenon occur?


-- Basically I wanted to see how do you say this? Are you seeing some commit statement getting fired lately after another commit statement. How do you say, it is waiting. I suppose you looked into some logs and came to this conclusion. So, wanted to see the same logs.
avseq anthoy
Ranch Hand

Joined: Apr 27, 2004
Posts: 104
Hibernate Transaction filter as below


I refine the log as below, the red text is the log entries about transaction begin and commit in the HibernateTransactionFilter

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] JspEngine --> /popupPage/CopyGrpTree.jsp

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] ServletPath: /popupPage/CopyGrpTree.jsp

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] PathInfo: null

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] RealPath: D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\iportal\popupPage\CopyGrpTree.jsp

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] RequestURI: /iportal/popupPage/CopyGrpTree.jsp

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] QueryString: null

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] Request Params:


[11/01/17 14:46:56][com.taiwanmobile.iportal.filter.HibernateSessionRequestFilter#doFilter] Filter Transaction begin...

[11/01/17 14:46:56][com.taiwanmobile.iportal.filter.HibernateSessionRequestFilter#doFilter] Transaction Begin

[11/01/17 14:46:56][com.taiwanmobile.iportal.filter.HibernateSessionRequestFilter#doFilter] Filter Transaction begin...

[11/01/17 14:46:56][com.taiwanmobile.iportal.filter.HibernateSessionRequestFilter#doFilter] Transaction Begin

[11/01/17 14:46:56][com.taiwanmobile.iportal.filter.HibernateSessionRequestFilter#doFilter] Transaction Begin ok

[11/01/17 14:46:56][org.springframework.web.servlet.DispatcherServlet#getHandler] Testing handler map [org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping@30f369] in DispatcherServlet with name 'dispatcherServlet'

[11/01/17 14:46:56][org.springframework.web.servlet.handler.AbstractUrlHandlerMapping#getHandlerInternal] Looking up handler for [/mngGrp.do]

[11/01/17 14:46:56][org.springframework.web.servlet.DispatcherServlet#getHandlerAdapter] Testing handler adapter [org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter@13cba41]

[11/01/17 14:46:56][org.springframework.web.servlet.DispatcherServlet#getHandlerAdapter] Testing handler adapter [org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter@1127c4d]

[11/01/17 14:46:56][org.springframework.web.servlet.DispatcherServlet#getLastModified] Last-Modified value for [/iportal/mngGrp.do] is: -1

[11/01/17 14:46:56][org.springframework.web.servlet.DispatcherServlet#doService] DispatcherServlet with name 'dispatcherServlet' received request for [/iportal/mngGrp.do]

[11/01/17 14:46:56][org.springframework.web.servlet.DispatcherServlet#doDispatch] Bound request context to thread: org.apache.catalina.connector.RequestFacade@10a69f0

[11/01/17 14:46:56][org.springframework.web.servlet.DispatcherServlet#getHandlerAdapter] Testing handler adapter [org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter@13cba41]

[11/01/17 14:46:56][org.springframework.web.servlet.DispatcherServlet#getHandlerAdapter] Testing handler adapter [org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter@1127c4d]

[11/01/17 14:46:56][org.springframework.beans.factory.support.AbstractBeanFactory#doGetBean] Returning cached instance of singleton bean 'CompanyInfoMap'

[11/01/17 14:46:56][org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory#invokeInitMethods] Invoking afterPropertiesSet() on bean with name 'popupPage/CopyGrpTreeLeft'

[11/01/17 14:46:56][org.springframework.web.servlet.view.AbstractCachingViewResolver#resolveViewName] Cached view [popupPage/CopyGrpTreeLeft]

[11/01/17 14:46:56][org.springframework.web.servlet.DispatcherServlet#render] Rendering view [org.springframework.web.servlet.view.JstlView: name 'popupPage/CopyGrpTreeLeft'; URL [popupPage/CopyGrpTreeLeft.jsp]] in DispatcherServlet with name 'dispatcherServlet'

[11/01/17 14:46:56][org.springframework.web.servlet.view.AbstractView#render] Rendering view with name 'popupPage/CopyGrpTreeLeft' with model {list=[com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@f4ec4093, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@fe38dfc1, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@bc3e4a3, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@ef47aef9, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@a93f89c3, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@5e374a5f, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@ee90b31c, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@6c6d05a1, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@c8b41dc, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@b2cf2f6c, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@61e4e04c, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@d65f85ac, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@cea2db43, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@4e271d6e, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@c83e883, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@d914c24f, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@c3a1be35, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@99ed6515, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@f025c10b, com.taiwanmobile.iportal.dao.iportaldb.GrpInfo@98f9cf09], act=redirect_grp_query, pagingInfo=com.taiwanmobile.iportal.util.Paging@1d1358f, companyMap={1=abc, 2=def, 3=ijk , 4=mno}, queryName=} and static attributes {}

[11/01/17 14:46:56][org.springframework.web.servlet.view.AbstractView#exposeModelAsRequestAttributes] Added model object 'list' of type [java.util.ArrayList] to request in view with name 'popupPage/CopyGrpTreeLeft'

[11/01/17 14:46:56][org.springframework.web.servlet.view.AbstractView#exposeModelAsRequestAttributes] Added model object 'act' of type [java.lang.String] to request in view with name 'popupPage/CopyGrpTreeLeft'

[11/01/17 14:46:56][org.springframework.web.servlet.view.AbstractView#exposeModelAsRequestAttributes] Added model object 'companyMap' of type [java.util.HashMap] to request in view with name 'popupPage/CopyGrpTreeLeft'

[11/01/17 14:46:56][org.springframework.web.servlet.view.AbstractView#exposeModelAsRequestAttributes] Added model object 'pagingInfo' of type [com.taiwanmobile.iportal.util.Paging] to request in view with name 'popupPage/CopyGrpTreeLeft'

[11/01/17 14:46:56][org.springframework.web.servlet.view.AbstractView#exposeModelAsRequestAttributes] Added model object 'queryName' of type [java.lang.String] to request in view with name 'popupPage/CopyGrpTreeLeft'

[11/01/17 14:46:56][org.apache.catalina.core.ApplicationDispatcher#<init>] servletPath=/popupPage/CopyGrpTreeLeft.jsp, pathInfo=null, queryString=null, name=null

[11/01/17 14:46:56][org.springframework.web.servlet.view.InternalResourceView#renderMergedOutputModel] Forwarding to resource [popupPage/CopyGrpTreeLeft.jsp] in InternalResourceView 'popupPage/CopyGrpTreeLeft'

[11/01/17 14:46:56][org.apache.catalina.core.ApplicationDispatcher#doForward] Path Based Forward

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] JspEngine --> /popupPage/CopyGrpTreeLeft.jsp

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] ServletPath: /popupPage/CopyGrpTreeLeft.jsp

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] PathInfo: null

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] RealPath: D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\iportal\popupPage\CopyGrpTreeLeft.jsp

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] RequestURI: /iportal/popupPage/CopyGrpTreeLeft.jsp

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] QueryString: act=popup_grp_query

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] Request Params:

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] act = popup_grp_query

[11/01/17 14:46:56][org.apache.catalina.core.ApplicationDispatcher#<init>] servletPath=/template/CopyGrpTreePaging.jsp, pathInfo=null, queryString=null, name=null

[11/01/17 14:46:56][org.apache.catalina.core.ApplicationDispatcher#doInclude] Path Based Include

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] JspEngine --> /template/CopyGrpTreePaging.jsp

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] ServletPath: /popupPage/CopyGrpTreeLeft.jsp

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] PathInfo: null

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] RealPath: D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\iportal\template\CopyGrpTreePaging.jsp

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] RequestURI: /iportal/popupPage/CopyGrpTreeLeft.jsp

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] QueryString: act=popup_grp_query

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] Request Params:

[11/01/17 14:46:56][org.apache.jasper.servlet.JspServlet#service] act = popup_grp_query

[11/01/17 14:46:56][org.apache.catalina.core.ApplicationDispatcher#doForward] Disabling the response for futher output

[11/01/17 14:46:56][org.springframework.web.servlet.DispatcherServlet#doDispatch] Cleared thread-bound request context: org.apache.catalina.connector.RequestFacade@10a69f0

[11/01/17 14:46:56][org.springframework.web.servlet.FrameworkServlet#processRequest] Successfully completed request

[11/01/17 14:46:56][org.springframework.context.support.AbstractApplicationContext#publishEvent] Publishing event in context [org.springframework.web.context.support.XmlWebApplicationContext@1bb205a]: ServletRequestHandledEvent: url=[/iportal/mngGrp.do]; client=[127.0.0.1]; method=[GET]; servlet=[dispatcherServlet]; session=[D9440CE41C66AFA2B84DA89D928A9937]; user=[null]; time=[63ms]; status=[OK]

[11/01/17 14:46:56][com.taiwanmobile.iportal.filter.HibernateSessionRequestFilter#doFilter] Transaction commit

[11/01/17 14:47:03][com.taiwanmobile.iportal.filter.HibernateSessionRequestFilter#doFilter] Transaction Begin ok


[11/01/17 14:47:03][org.springframework.web.servlet.DispatcherServlet#getHandler] Testing handler map [org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping@30f369] in DispatcherServlet with name 'dispatcherServlet'

[11/01/17 14:47:03][org.springframework.web.servlet.handler.AbstractUrlHandlerMapping#getHandlerInternal] Looking up handler for [/mngNode.do]

[11/01/17 14:47:03][org.springframework.web.servlet.DispatcherServlet#getHandlerAdapter] Testing handler adapter [org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter@13cba41]

[11/01/17 14:47:03][org.springframework.web.servlet.DispatcherServlet#getHandlerAdapter] Testing handler adapter [org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter@1127c4d]

[11/01/17 14:47:03][org.springframework.web.servlet.DispatcherServlet#getLastModified] Last-Modified value for [/iportal/mngNode.do] is: -1

[11/01/17 14:47:03][org.springframework.web.servlet.DispatcherServlet#doService] DispatcherServlet with name 'dispatcherServlet' received request for [/iportal/mngNode.do]

[11/01/17 14:47:03][org.springframework.web.servlet.DispatcherServlet#doDispatch] Bound request context to thread: org.apache.catalina.connector.RequestFacade@d8431c

[11/01/17 14:47:03][org.springframework.web.servlet.DispatcherServlet#getHandlerAdapter] Testing handler adapter [org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter@13cba41]

[11/01/17 14:47:03][org.springframework.web.servlet.DispatcherServlet#getHandlerAdapter] Testing handler adapter [org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter@1127c4d]

[11/01/17 14:47:03][com.taiwanmobile.iportal.facade.NodeFacade#showGrpTree] act=redirect_node_queryGrpTree01

[11/01/17 14:47:03][org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory#invokeInitMethods] Invoking afterPropertiesSet() on bean with name 'popupPage/CopyGrpTreeRight'

[11/01/17 14:47:03][org.springframework.web.servlet.view.AbstractCachingViewResolver#resolveViewName] Cached view [popupPage/CopyGrpTreeRight]

[11/01/17 14:47:03][org.springframework.web.servlet.DispatcherServlet#render] Rendering view [org.springframework.web.servlet.view.JstlView: name 'popupPage/CopyGrpTreeRight'; URL [popupPage/CopyGrpTreeRight.jsp]] in DispatcherServlet with name 'dispatcherServlet'

[11/01/17 14:47:03][org.springframework.web.servlet.view.AbstractView#render] Rendering view with name 'popupPage/CopyGrpTreeRight' with model {isNodeSaved=false, IportalTreeNodes=[]} and static attributes {}

[11/01/17 14:47:03][org.springframework.web.servlet.view.AbstractView#exposeModelAsRequestAttributes] Added model object 'isNodeSaved' of type [java.lang.Boolean] to request in view with name 'popupPage/CopyGrpTreeRight'

[11/01/17 14:47:03][org.springframework.web.servlet.view.AbstractView#exposeModelAsRequestAttributes] Added model object 'IportalTreeNodes' of type [java.util.ArrayList] to request in view with name 'popupPage/CopyGrpTreeRight'

[11/01/17 14:47:03][org.apache.catalina.core.ApplicationDispatcher#<init>] servletPath=/popupPage/CopyGrpTreeRight.jsp, pathInfo=null, queryString=null, name=null

[11/01/17 14:47:03][org.springframework.web.servlet.view.InternalResourceView#renderMergedOutputModel] Forwarding to resource [popupPage/CopyGrpTreeRight.jsp] in InternalResourceView 'popupPage/CopyGrpTreeRight'

[11/01/17 14:47:03][org.apache.catalina.core.ApplicationDispatcher#doForward] Path Based Forward

[11/01/17 14:47:03][org.apache.jasper.servlet.JspServlet#service] JspEngine --> /popupPage/CopyGrpTreeRight.jsp

[11/01/17 14:47:03][org.apache.jasper.servlet.JspServlet#service] ServletPath: /popupPage/CopyGrpTreeRight.jsp

[11/01/17 14:47:03][org.apache.jasper.servlet.JspServlet#service] PathInfo: null

[11/01/17 14:47:03][org.apache.jasper.servlet.JspServlet#service] RealPath: D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\iportal\popupPage\CopyGrpTreeRight.jsp

[11/01/17 14:47:03][org.apache.jasper.servlet.JspServlet#service] RequestURI: /iportal/popupPage/CopyGrpTreeRight.jsp

[11/01/17 14:47:03][org.apache.jasper.servlet.JspServlet#service] QueryString: act=redirect_node_queryGrpTree01&default=yes

[11/01/17 14:47:03][org.apache.jasper.servlet.JspServlet#service] Request Params:

[11/01/17 14:47:03][org.apache.jasper.servlet.JspServlet#service] act = redirect_node_queryGrpTree01

[11/01/17 14:47:03][org.apache.jasper.servlet.JspServlet#service] default = yes

[11/01/17 14:47:03][org.apache.catalina.core.ApplicationDispatcher#doForward] Disabling the response for futher output

[11/01/17 14:47:03][org.springframework.web.servlet.DispatcherServlet#doDispatch] Cleared thread-bound request context: org.apache.catalina.connector.RequestFacade@d8431c

[11/01/17 14:47:03][org.springframework.web.servlet.FrameworkServlet#processRequest] Successfully completed request

[11/01/17 14:47:03][org.springframework.context.support.AbstractApplicationContext#publishEvent] Publishing event in context [org.springframework.web.context.support.XmlWebApplicationContext@1bb205a]: ServletRequestHandledEvent: url=[/iportal/mngNode.do]; client=[127.0.0.1]; method=[GET]; servlet=[dispatcherServlet]; session=[D9440CE41C66AFA2B84DA89D928A9937]; user=[null]; time=[16ms]; status=[OK]

[11/01/17 14:47:03][com.taiwanmobile.iportal.filter.HibernateSessionRequestFilter#doFilter] Transaction commit
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate transaction begin stuck