CDV ❯ Write lock nested in read lock throws exception
-
Bug
-
Status: Closed
-
2 Major
-
Resolution: Incomplete
-
DSO:L1
-
-
eellis00
-
Reporter: eellis00
-
December 05, 2008
-
0
-
Watchers: 0
-
February 17, 2009
-
February 16, 2009
Description
Since when does a write lock need to release it’s read lock?
******************************************************************************* Lock upgrade is not supported. The READ lock needs to be unlocked before a WRITE lock can be requested.
*******************************************************************************
at com.tc.object.lockmanager.impl.ClientLock.basicLock(ClientLock.java:149)
at com.tc.object.lockmanager.impl.ClientLock.lock(ClientLock.java:118)
at com.tc.object.lockmanager.impl.ClientLock.lock(ClientLock.java:108)
at com.tc.object.lockmanager.impl.ClientLockManagerImpl.lock(ClientLockManagerImpl.java:311)
at com.tc.object.lockmanager.impl.StripedClientLockManagerImpl.lock(StripedClientLockManagerImpl.java:119)
at com.tc.object.lockmanager.impl.ThreadLockManagerImpl.lock(ThreadLockManagerImpl.java:55)
at com.tc.object.tx.ClientTransactionManagerImpl.begin(ClientTransactionManagerImpl.java:187)
at com.tc.object.bytecode.ManagerImpl.begin(ManagerImpl.java:331)
at com.tc.object.bytecode.ManagerImpl.monitorEnter(ManagerImpl.java:501)
at com.tc.object.bytecode.ManagerUtil.monitorEnterWithContextInfo(ManagerUtil.java:469)
at net.jforum.entities.UserSession.setModeratorAssignments(UserSession.java)
at net.jforum.entities.UserSession.__tc_wrapped_isZDMModerator(UserSession.java:382)
at net.jforum.entities.UserSession.isZDMModerator(UserSession.java)
at net.jforum.security.PermissionControl.hasZDMModeratorOverride(PermissionControl.java:180)
at net.jforum.security.PermissionControl.__tc_wrapped_canAccess(PermissionControl.java:142)
at net.jforum.security.PermissionControl.canAccess(PermissionControl.java)
at net.jforum.repository.SecurityRepository.canAccess(SecurityRepository.java:214)
at net.jforum.repository.SecurityRepository.canAccess(SecurityRepository.java:180)
at net.jforum.entities.UserSession.__tc_wrapped_isModerator(UserSession.java:341)
at net.jforum.entities.UserSession.isModerator(UserSession.java)
at net.jforum.exceptions.ExceptionWriter.handleExceptionData(ExceptionWriter.java:98)
at net.jforum.JForum.handleException(JForum.java:303)
at net.jforum.JForum.service(JForum.java:222)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at net.jforum.util.legacy.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:59)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at com.tc.tomcat55.session.SessionValve55.tcInvoke(SessionValve55.java:63)
at com.tc.tomcat55.session.SessionValve55.invoke(SessionValve55.java:50)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:619)
Comments
Steve Harris 2008-12-05
Fiona OShea 2009-02-16
Resolving as no feedback received to date
Having upgradable locks leads to almost guaranteed deadlocks. Run through the scenarios in your head a bit and see if it is really what you want.