Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-2134

Cannot rollback a document to its first revision

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.3 M2
    • Fix Version/s: 1.3 RC1
    • Component/s: {Unused} Core
    • Labels:
      None
    • Tests:
      Integration
    • Similar issues:

      Description

      How to reproduce:

      • Build XE from trunk
      • Execute xe in xe/distribution/hsqldb/target
      • Go Main.WebHome, edit it and replace the content with "aaa"
      • Try to rollback to version 1.1, you'll get the following exceptions:
              Error number 3201 in 3: Exception while saving document Main.WebHome
      Wrapped Exception: a different object with the same identifier value was already associated with the session: [com.xpn.xwiki.doc.XWikiDocument#-114121954]
      com.xpn.xwiki.XWikiException: Error number 3201 in 3: Exception while saving document Main.WebHome
      Wrapped Exception: a different object with the same identifier value was already associated with the session: [com.xpn.xwiki.doc.XWikiDocument#-114121954]
      	at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:455)
      	at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:97)
      	at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:91)
      	at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1077)
      	at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1050)
      	at com.xpn.xwiki.XWiki.rollback(XWiki.java:6101)
      	at com.xpn.xwiki.web.RollbackAction.action(RollbackAction.java:59)
      	at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:188)
      	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
      	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
      	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
      	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:596)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
      	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
      	at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:830)
      	at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:117)
      	at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
      	at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471)
      	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
      	at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
      	at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633)
      	at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
      	at org.mortbay.http.HttpServer.service(HttpServer.java:954)
      	at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
      	at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:983)
      	at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
      	at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
      	at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
      	at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
      
      
      Wrapped Exception:
      
      org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [com.xpn.xwiki.doc.XWikiDocument#-114121954]
      	at org.hibernate.engine.StatefulPersistenceContext.checkUniqueness(StatefulPersistenceContext.java:590)
      	at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performUpdate(DefaultSaveOrUpdateEventListener.java:284)
      	at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsDetached(DefaultSaveOrUpdateEventListener.java:223)
      	at org.hibernate.event.def.DefaultUpdateEventListener.performSaveOrUpdate(DefaultUpdateEventListener.java:33)
      	at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
      	at org.hibernate.impl.SessionImpl.fireUpdate(SessionImpl.java:564)
      	at org.hibernate.impl.SessionImpl.update(SessionImpl.java:552)
      	at org.hibernate.impl.SessionImpl.update(SessionImpl.java:544)
      	at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:360)
      	at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:97)
      	at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:91)
      	at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1077)
      	at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1050)
      	at com.xpn.xwiki.XWiki.rollback(XWiki.java:6101)
      	at com.xpn.xwiki.web.RollbackAction.action(RollbackAction.java:59)
      	at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:188)
      	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
      	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
      	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
      	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:596)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
      	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
      	at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:830)
      	at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:117)
      	at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
      	at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471)
      	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
      	at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
      	at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633)
      	at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
      	at org.mortbay.http.HttpServer.service(HttpServer.java:954)
      	at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
      	at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:983)
      	at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
      	at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
      	at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
      	at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
      

        Attachments

          Activity

            People

            • Assignee:
              amelentev Artem Melentev
              Reporter:
              vmassol Vincent Massol
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: