Author: sdumitriu
Date: 2007-11-28 16:18:33 +0100 (Wed, 28 Nov 2007)
New Revision: 6112

Modified:
   
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Log:
XWIKI-1891: Failure to delete documents on xwiki.org
Probably mostly fixed. Seems that we're using a SoftReference and we never 
check if the referenced object was garbage-collected in the meantime.
This change was introduced in rev. 1124 ( 
http://fisheye2.cenqua.com/changelog/xwiki?cs=1124 ), so it's strange that 
nobody reported the error since then.
I still have to check if the reference can be broken between reloading the 
archive and putting a strong reference to the real archive in the context. 
Probably yes, and we'll have to use a synchronized code.



Modified: 
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
===================================================================
--- 
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
     2007-11-28 14:33:45 UTC (rev 6111)
+++ 
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
     2007-11-28 15:18:33 UTC (rev 6112)
@@ -841,7 +841,7 @@
 
     public void loadArchive(XWikiContext context) throws XWikiException
     {
-        if (archive == null) {
+        if (archive == null || archive.get() == null) {
             XWikiDocumentArchive arch =
                 getVersioningStore(context).getXWikiDocumentArchive(this, 
context);
             // We are using a SoftReference which will allow the archive to be

_______________________________________________
notifications mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/notifications

Reply via email to