Duplicate User causes Exception upon inserting Wiki

Issue #2462 resolved
Stephan Doerfel created an issue

How is it possible that activating a user yields a duplicate? The CV should only be added, when the has successfully been inserted.

#!
[2015-03-25 08:44:12,372] [ERROR] [org.bibsonomy.database.common.impl.DBSessionImpl] - Couldn't execute query 'insertWiki' - throwing RuntimeException
com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in Wiki.xml.  
--- The error occurred while applying a parameter map.  
--- Check the insertWiki-InlineParameterMap.  
--- Check the statement (update failed).  
--- Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'cornsherry' for key 1
com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in Wiki.xml.  
--- The error occurred while applying a parameter map.  
--- Check the insertWiki-InlineParameterMap.  
--- Check the statement (update failed).  
--- Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'cornsherry' for key 1
        at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedStatement.java:107)
        at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:393)
        at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:82)
        at org.bibsonomy.database.common.impl.DBSessionImpl.insert(DBSessionImpl.java:257)
        at org.bibsonomy.database.common.AbstractDatabaseManager.insert(AbstractDatabaseManager.java:133)
        at org.bibsonomy.database.managers.UserDatabaseManager.insertDefaultWiki(UserDatabaseManager.java:1200)
        at org.bibsonomy.database.managers.UserDatabaseManager.performActivationSteps(UserDatabaseManager.java:1181)
        at org.bibsonomy.database.managers.UserDatabaseManager.activateUser(UserDatabaseManager.java:1165)
        at org.bibsonomy.database.DBLogic.updateUser(DBLogic.java:1721)
        at org.bibsonomy.webapp.controller.actions.UserActivationController.workOn(UserActivationController.java:137)
        at org.bibsonomy.webapp.controller.actions.UserActivationController.workOn(UserActivationController.java:66)
        at org.bibsonomy.webapp.util.spring.controller.MinimalisticControllerSpringWrapper.handleRequestInternal(MinimalisticControllerSpringWrapper.java:230)
        at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
        at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)

Comments (11)

  1. Thomas Niebler

    Any suggestions on how to fix this? Should I just put a try-catch-block around it? I just checked the code and I have no idea how this should occur (other than multithreaded stuff!?)

  2. Log in to comment