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

Check Hibernate Database when looking for invalid links

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • 11.10.11
    • Rendering
    • None
    • Unknown

    Description

      When renaming a page which contains invalid links like:

      [[user:email@domain.com]]

      XWiki is generating errors on check hibernate database with the below stack trace. It is checking if the page exists in the "user" wiki although the "user" wiki does not exists. So it checks if the database is up to date (and so on). If there are multiple links it will repeat the check over and over again.

      This causes an issue with the Nested Pages Migration or other batch migration that become very slow. The issue is related to Confluence import as the confluence import can generate such invalid links in masses.

      at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:103)
      at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
      at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)
      at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99)
      at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:200)
      at org.hibernate.engine.query.spi.NativeSQLQueryPlan.performExecuteUpdate(NativeSQLQueryPlan.java:107)
      at org.hibernate.internal.SessionImpl.executeNativeUpdate(SessionImpl.java:1491)
      at org.hibernate.query.internal.NativeQueryImpl.doExecuteUpdate(NativeQueryImpl.java:295)
      at org.hibernate.query.internal.AbstractProducedQuery.executeUpdate(AbstractProducedQuery.java:1605)
      at com.xpn.xwiki.internal.store.hibernate.HibernateStore.createSequenceIfMissing(HibernateStore.java:1058)
      at com.xpn.xwiki.internal.store.hibernate.HibernateStore.updateDatabase(HibernateStore.java:947)
      at com.xpn.xwiki.internal.store.hibernate.HibernateStore.updateDatabase(HibernateStore.java:1097)
      at com.xpn.xwiki.store.XWikiHibernateBaseStore.updateSchema(XWikiHibernateBaseStore.java:274)
      at com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.hibernateShemaUpdate(HibernateDataMigrationManager.java:207)
      at com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.updateSchema(HibernateDataMigrationManager.java:188)
      at com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.initializeEmptyDB(HibernateDataMigrationManager.java:157)
      at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.initNewDB(AbstractDataMigrationManager.java:446)
      at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.initializeCurrentDatabase(AbstractDataMigrationManager.java:551)
      at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.checkDatabase(AbstractDataMigrationManager.java:534)
      at com.xpn.xwiki.internal.store.hibernate.HibernateStore.setWiki(HibernateStore.java:673)
      at com.xpn.xwiki.internal.store.hibernate.HibernateStore.setWiki(HibernateStore.java:634)
      at com.xpn.xwiki.internal.store.hibernate.HibernateStore.beginTransaction(HibernateStore.java:811)
      at com.xpn.xwiki.store.XWikiHibernateBaseStore.beginTransaction(XWikiHibernateBaseStore.java:577)
      at com.xpn.xwiki.store.XWikiHibernateStore.exists(XWikiHibernateStore.java:456)
      at com.xpn.xwiki.store.XWikiCacheStore.exists(XWikiCacheStore.java:727)
      at com.xpn.xwiki.XWiki.exists(XWiki.java:6220)
      at com.xpn.xwiki.doc.DefaultDocumentAccessBridge.exists(DefaultDocumentAccessBridge.java:250)
      at org.xwiki.rendering.internal.resolver.AbstractResourceReferenceEntityReferenceResolver.resolveDocumentReference(AbstractResourceReferenceEntityReferenceResolver.java:179)
      at org.xwiki.rendering.internal.resolver.AbstractResourceReferenceEntityReferenceResolver.resolveDocumentReference(AbstractResourceReferenceEntityReferenceResolver.java:167)
      at org.xwiki.rendering.internal.resolver.DocumentResourceReferenceEntityReferenceResolver.resolveUntyped(DocumentResourceReferenceEntityReferenceResolver.java:86)
      at org.xwiki.rendering.internal.resolver.AbstractResourceReferenceEntityReferenceResolver.resolve(AbstractResourceReferenceEntityReferenceResolver.java:103)
      at org.xwiki.rendering.internal.resolver.AbstractResourceReferenceEntityReferenceResolver.resolve(AbstractResourceReferenceEntityReferenceResolver.java:46)
      at org.xwiki.rendering.internal.resolver.DefaultResourceReferenceEntityReferenceResolver.resolve(DefaultResourceReferenceEntityReferenceResolver.java:77)
      at org.xwiki.rendering.internal.resolver.DefaultResourceReferenceEntityReferenceResolver.resolve(DefaultResourceReferenceEntityReferenceResolver.java:44)
      at com.xpn.xwiki.internal.render.DefaultOldRendering.refactorDocumentLinks(DefaultOldRendering.java:149)
      at com.xpn.xwiki.internal.render.DefaultOldRendering.renameLinks(DefaultOldRendering.java:108)
      at com.xpn.xwiki.doc.XWikiDocument.renameLinks(XWikiDocument.java:6991)
      at com.xpn.xwiki.doc.XWikiDocument.rename(XWikiDocument.java:6904)
      at com.xpn.xwiki.doc.XWikiDocument.rename(XWikiDocument.java:6843)
      at com.xpn.xwiki.doc.XWikiDocument.rename(XWikiDocument.java:6805)
      at com.xpn.xwiki.api.Document.rename(Document.java:2973)
      at com.xpn.xwiki.api.Document.rename(Document.java:2957)
      at com.xpn.xwiki.api.Document$rename$0.call(Unknown Source)

      Nested stack trace:

      Caused by: class org.postgresql.util.PSQLException: ERROR: relation "xwikidbversion" does not exist
      Position: 13
      at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2553)
      at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2285)
      at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:323)
      at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:473)
      at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:393)
      at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:164)
      at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:130)
      at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136)
      at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136)
      at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:197)
      at org.hibernate.hql.internal.ast.exec.BasicExecutor.doExecute(BasicExecutor.java:100)

      Attachments

        Activity

          People

            Unassigned Unassigned
            ludovic Ludovic Dubost
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: