Defect #571

Database exceptions executing the new DB Based Wave indexer (at bootstrap reindex)

Added by Pablo Ojanguren almost 11 years ago. Updated almost 11 years ago.

Status:ClosedStart date:01/13/2014
Priority:UrgentDue date:
Assignee:Pablo Ojanguren% Done:

100%

Category:-
Target version:-
Resolution: Tags:

Description

Testing HEAD revision (5b94e3f9) of kune/trunk in a local environment following exceptions were thrown related to DB index for Wave:

Execution 1

- Executed bin/liquibase-migrate.sh succesfully, some new tables were added to kune_dev database
- Kune Started with mvn exec:java, navigated to localhost:8888, the browser got frozen loading kune, after some seconds following exception is thrown in server as anwser to a client call:

SEVERE: Workspace adaptation to your language failed: 500 <html>

Error while committing the transaction</p><h3>Caused by:</h3>javax.persistence.RollbackException: Error while committing the transaction
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.
Caused by:</h3>org.hibernate.TransactionException: unable to commit against JDBC connection
Caused by:</h3>com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.

- Table kune_dev.participants_waves was empty but tables kune_dev.participants and kune_dev.waves had values.

Execution 2

- Deleted data from tables kune_dev.participants_waves, kune_dev.participant, kune_dev.waves
- Kune Started with mvn exec:java, before navigating to localhost:8888 following exception was thrown:

2014-01-13 17:36:51 KuneJpaLocalTxnInterceptor [DEBUG] Exception in transaction
javax.persistence.PersistenceException: org.hibernate.PersistentObjectException: detached entity passed to persist: cc.kune.domain.ParticipantEntity
    at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1365)
    at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1293)
    at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1299)
    at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:865)
    at cc.kune.core.server.manager.impl.DefaultManager.persist(DefaultManager.java:176)
    at cc.kune.core.server.manager.impl.DefaultManager.persist(DefaultManager.java:188)
    at cc.kune.core.server.manager.impl.WaveEntityManagerDefault.add(WaveEntityManagerDefault.java:65)
    at com.google.inject.persist.jpa.KuneJpaLocalTxnInterceptor.invoke(KuneJpaLocalTxnInterceptor.java:98)
    at cc.kune.wave.server.search.CustomPerUserWaveViewHandlerImpl.addWaveToUser(CustomPerUserWaveViewHandlerImpl.java:77)
    at cc.kune.wave.server.search.CustomPerUserWaveViewHandlerImpl.onWaveInit(CustomPerUserWaveViewHandlerImpl.java:179)
    at cc.kune.wave.server.search.CustomWaveIndexerImpl.processWavelet(CustomWaveIndexerImpl.java:56)
    at org.waveprotocol.box.server.waveserver.AbstractWaveIndexer.remakeIndex(AbstractWaveIndexer.java:57)
    at cc.kune.wave.server.CustomServerMain.reindex(CustomServerMain.java:403)
    at cc.kune.wave.server.CustomServerMain.run(CustomServerMain.java:232)
    at cc.kune.wave.server.CustomServerMain.main(CustomServerMain.java:162)

- The server crashed after that caused by PermGem (the server wasn't started with enoug PermGem space)

Execution 3

- Deleted data from tables kune_dev.participants_waves, kune_dev.participant, kune_dev.waves
- Kune Started with mvn exec:java, before navigating to localhost:8888 following exception was thrown:

2014-01-13 17:53:59 CustomPerUserWaveViewHandlerImpl [DEBUG] On wave init of wave [WaveletName localhost/w+mjy7b62xajpdA/localhost/conv+root]
2014-01-13 17:53:59 KuneJpaLocalTxnInterceptor [DEBUG] Starting transaction
2014-01-13 17:53:59 KuneJpaLocalTxnInterceptor [DEBUG] Exception in transaction
javax.persistence.NoResultException: No entity found for query
    at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:290)
    at com.google.inject.persist.jpa.JpaFinderProxy.invoke(JpaFinderProxy.java:72)
    at com.google.inject.persist.jpa.JpaPersistModule$1.invoke(JpaPersistModule.java:129)
    at com.sun.proxy.$Proxy56.find(Unknown Source)
    at cc.kune.core.server.manager.impl.WaveEntityManagerDefault.find(WaveEntityManagerDefault.java:71)
    at com.google.inject.persist.jpa.KuneJpaLocalTxnInterceptor.invoke(KuneJpaLocalTxnInterceptor.java:98)
    at cc.kune.wave.server.search.CustomPerUserWaveViewHandlerImpl.getWaveEntity(CustomPerUserWaveViewHandlerImpl.java:93)
    at cc.kune.wave.server.search.CustomPerUserWaveViewHandlerImpl.onWaveInit(CustomPerUserWaveViewHandlerImpl.java:176)
    at cc.kune.wave.server.search.CustomWaveIndexerImpl.processWavelet(CustomWaveIndexerImpl.java:56)
    at org.waveprotocol.box.server.waveserver.AbstractWaveIndexer.remakeIndex(AbstractWaveIndexer.java:57)
    at cc.kune.wave.server.CustomServerMain.reindex(CustomServerMain.java:403)
    at cc.kune.wave.server.CustomServerMain.run(CustomServerMain.java:232)
    at cc.kune.wave.server.CustomServerMain.main(CustomServerMain.java:162)

- Navigated to localhost:8888 succesfully but this exception is thrown:

    2014-01-13 17:58:05 KuneJpaLocalTxnInterceptor [DEBUG] Exception in transaction
javax.persistence.NoResultException: No entity found for query
    at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:290)
    at com.google.inject.persist.jpa.JpaFinderProxy.invoke(JpaFinderProxy.java:72)
    at com.google.inject.persist.jpa.JpaPersistModule$1.invoke(JpaPersistModule.java:129)
    at com.sun.proxy.$Proxy56.find(Unknown Source)
    at cc.kune.core.server.manager.impl.WaveEntityManagerDefault.find(WaveEntityManagerDefault.java:71)
    at com.google.inject.persist.jpa.KuneJpaLocalTxnInterceptor.invoke(KuneJpaLocalTxnInterceptor.java:98)
    at cc.kune.wave.server.search.CustomPerUserWaveViewHandlerImpl.getWaveEntity(CustomPerUserWaveViewHandlerImpl.java:93)
    at cc.kune.wave.server.search.CustomPerUserWaveViewHandlerImpl.access$1(CustomPerUserWaveViewHandlerImpl.java:85)
    at cc.kune.wave.server.search.CustomPerUserWaveViewHandlerImpl$1.call(CustomPerUserWaveViewHandlerImpl.java:127)
    at cc.kune.wave.server.search.CustomPerUserWaveViewHandlerImpl$1.call(CustomPerUserWaveViewHandlerImpl.java:1)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:662)

Associated revisions

History

#1 Updated by Pablo Ojanguren almost 11 years ago

  • Assignee set to Pablo Ojanguren

Problem is at WaveEntityManagerDefault.java:65, use merge() instead of persist()

  @Override
  @KuneTransactional
  public void add(final WaveEntity wave, final ParticipantEntity participant) {
    wave.add(participant);
    merge(wave); 
    // persist(wave); <- participant and wave objects are already persisted objects
  }

#2 Updated by Pablo Ojanguren almost 11 years ago

  • Subject changed from Database exceptions executing the new DB Based Wave indexer to Database exceptions executing the new DB Based Wave indexer (at bootstrap reindex)

#3 Updated by Pablo Ojanguren almost 11 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Fixed in commit 204e97d

Also available in: Atom PDF