Andreas Hartmann wrote:
Hi Richard,

[EMAIL PROTECTED] schrieb:
Author: rfrovarp
Date: Fri Aug 31 07:13:27 2007
New Revision: 571475

URL: http://svn.apache.org/viewvc?rev=571475&view=rev
Log:
Synchronize access to committed.

did you find an indication that the commit() method of a single
SessionImpl object is invoked by more than one thread? Actually this
should never be the case. The critical part further down the method is
synchronized via the global transaction lock, which should prevent any
concurrency issues during the committing of sessions.

-- Andreas



No, I have not found any indication as such. However, in r564653 you added the committed variable (among other things). It is checked in a synchronized method down in enqueueEvent. Which was made synchronized only when you added the committed variable. It would stand to reason if that function is synchronized because of that variable, the function modifying it should be synchronized on the same monitor as well. I could be wrong, but that is how the bug was found, and my reasoning for the change.

Richard

Modified:
    lenya/trunk/src/java/org/apache/lenya/cms/repository/SessionImpl.java

Modified: lenya/trunk/src/java/org/apache/lenya/cms/repository/SessionImpl.java
URL: 
http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/repository/SessionImpl.java?rev=571475&r1=571474&r2=571475&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/repository/SessionImpl.java 
(original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/repository/SessionImpl.java Fri 
Aug 31 07:13:27 2007
@@ -130,7 +130,7 @@
      * @throws ConcurrentModificationException if a transactionable has been 
modified by another
      *         session.
      */
-    public void commit() throws RepositoryException, 
ConcurrentModificationException {
+    public synchronized void commit() throws RepositoryException, 
ConcurrentModificationException {
savePersistables();






--
Richard Frovarp
EduTech System Administrator
1-701-231-5127 or 1-800-774-1091


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to