List Info

Thread: Re: svn commit: r571475 - /lenya/trunk/src/java/org/apache/lenya/cms/repository/SessionImpl.java




Re: svn commit: r571475 - /lenya/trunk/src/java/org/apache/lenya/c ms/repository/SessionImpl.java
country flaguser name
Switzerland
2007-08-31 09:23:43
Hi Richard,

rfrovarpapache.org 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


> 
> Modified:
>    
lenya/trunk/src/java/org/apache/lenya/cms/repository/Session
Impl.java
> 
> Modified:
lenya/trunk/src/java/org/apache/lenya/cms/repository/Session
Impl.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/Session
Impl.java (original)
> +++
lenya/trunk/src/java/org/apache/lenya/cms/repository/Session
Impl.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();




-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch


------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribelenya.apache.org
For additional commands, e-mail: dev-helplenya.apache.org


Re: svn commit: r571475 - /lenya/trunk/src/java/org/apache/lenya/c ms/repository/SessionImpl.java
country flaguser name
United States
2007-08-31 10:00:27
Andreas Hartmann wrote:
> Hi Richard,
>
> rfrovarpapache.org 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/Session
Impl.java
>>
>> Modified:
lenya/trunk/src/java/org/apache/lenya/cms/repository/Session
Impl.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/Session
Impl.java (original)
>> +++
lenya/trunk/src/java/org/apache/lenya/cms/repository/Session
Impl.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: dev-unsubscribelenya.apache.org
For additional commands, e-mail: dev-helplenya.apache.org


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )