LibrePlan / libreplan

LibrePlan - Open Web Planning
https://www.libreplan.dev
GNU Affero General Public License v3.0
289 stars 170 forks source link

Creating new resource with criterions launches exception #340

Closed kwoot closed 6 years ago

kwoot commented 14 years ago

(Original Bugzilla Bug ID: 196)

Date: 2009-12-23 14:11:48 From: Xavi Castaño \<xcastanho@igalia.com> To: Javier Morán \<jmoran@igalia.com> Version: navalplan-1.1 (1.1.x) Last updated: 2011-11-15 16:55:47


(Note: this issue was migrated automatically with bugzilla2github.py tool )

kwoot commented 6 years ago

Bugzilla Comment ID: 469 Date: 2009-12-23 14:11:48 From: Xavi Castaño \<xcastanho@igalia.com>

This is a duplicated bug but I know how to reproduce it in attached dump:

Exception: 1115177 [Thread-17] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: null 1115177 [Thread-17] ERROR org.hibernate.util.JDBCExceptionReporter - Batch entry 0 / insert org.navalplanner.business.resources.entities.Worker / insert into Resource (version, calendar, id) values (0, 40299, 49291) was aborted. Call getNextException to see the cause. 1115177 [Thread-17] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 23505 1115178 [Thread-17] ERROR org.hibernate.util.JDBCExceptionReporter - ERROR: duplicate key value violates unique constraint "resource_calendar_key" 1115178 [Thread-17] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:254) at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:93) at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:88) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2227) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2655) at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:60) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1001) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:339) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106) at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:655) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701) at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy99.save(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.navalplanner.web.common.ExceptionCatcherProxy$1.invoke(ExceptionCatcherProxy.java:85) at $Proxy100.save(Unknown Source) at org.navalplanner.web.resources.worker.WorkerCRUDController.save(WorkerCRUDController.java:155) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at bsh.Reflect.invokeMethod(Unknown Source) at bsh.Reflect.invokeObjectMethod(Unknown Source) at bsh.Name.invokeMethod(Unknown Source) at bsh.BSHMethodInvocation.eval(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.Interpreter.eval(Unknown Source) at bsh.Interpreter.eval(Unknown Source) at org.zkoss.zk.scripting.bsh.BSHInterpreter.exec(BSHInterpreter.java:119) at org.zkoss.zk.scripting.util.GenericInterpreter.interpret(GenericInterpreter.java:310) at org.zkoss.zk.ui.impl.PageImpl.interpret(PageImpl.java:787) at org.zkoss.zk.ui.impl.EventProcessor.process0(EventProcessor.java:176) at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:141) at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.process0(EventProcessingThreadImpl.java:493) at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.run(EventProcessingThreadImpl.java:425) Caused by: java.sql.BatchUpdateException: Batch entry 0 / insert org.navalplanner.business.resources.entities.Worker / insert into Resource (version, calendar, id) values (0, 40299, 49291) was aborted. Call getNextException to see the cause. at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2537) at org.postgresql.core.v3.QueryExecutorImpl$1.handleError(QueryExecutorImpl.java:403) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1328) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:351) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2674) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:247) ... 47 more 23-Dec-2009 13:35:12 org.zkoss.zk.ui.impl.UiEngineImpl handleError:1131 SEVERE: >>org.springframework.dao.DataIntegrityViolationException: Could not execute JDBC batch update; nested exception is org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update

org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update [SQL: 0, null] java.sql.BatchUpdateException: Batch entry 0 / insert org.navalplanner.business.resources.entities.Worker / insert into Resource (version, calendar, id) values (0, 40299, 49291) was aborted. Call getNextException to see the cause. at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2537) at org.postgresql.core.v3.QueryExecutorImpl$1.handleError(QueryExecutorImpl.java:403) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1328) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:351) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2674) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48) ... 1115306 [91735188@qtp-253380575-13] ERROR org.navalplanner.web.error.PageForErrorOnEvent - Could not execute JDBC batch update; nested exception is org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update[SQL: 0, null] org.springframework.dao.DataIntegrityViolationException: Could not execute JDBC batch update; nested exception is org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:636) at org.springframework.orm.hibernate3.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:789) at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:663) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701) at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy99.save(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.navalplanner.web.common.ExceptionCatcherProxy$1.invoke(ExceptionCatcherProxy.java:85) at $Proxy100.save(Unknown Source) at org.navalplanner.web.resources.worker.WorkerCRUDController.save(WorkerCRUDController.java:155) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at bsh.Reflect.invokeMethod(Unknown Source) at bsh.Reflect.invokeObjectMethod(Unknown Source) at bsh.Name.invokeMethod(Unknown Source) at bsh.BSHMethodInvocation.eval(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.Interpreter.eval(Unknown Source) at bsh.Interpreter.eval(Unknown Source) at org.zkoss.zk.scripting.bsh.BSHInterpreter.exec(BSHInterpreter.java:119) at org.zkoss.zk.scripting.util.GenericInterpreter.interpret(GenericInterpreter.java:310) at org.zkoss.zk.ui.impl.PageImpl.interpret(PageImpl.java:787) at org.zkoss.zk.ui.impl.EventProcessor.process0(EventProcessor.java:176) at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:141) at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.process0(EventProcessingThreadImpl.java:493) at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.run(EventProcessingThreadImpl.java:425) Caused by: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:254) at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:93) at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:88) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2227) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2655) at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:60) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1001) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:339) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106) at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:655) ... 33 more Caused by: java.sql.BatchUpdateException: Batch entry 0 / insert org.navalplanner.business.resources.entities.Worker / insert into Resource (version, calendar, id) values (0, 40299, 49291) was aborted. Call getNextException to see the cause. at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2537) at org.postgresql.core.v3.QueryExecutorImpl$1.handleError(QueryExecutorImpl.java:403) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1328) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:351) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2674) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:247) ... 47 more

kwoot commented 6 years ago

Bugzilla Comment ID: 470 Date: 2009-12-23 17:03:39 From: Oscar González \<ogonzalez@igalia.com>

This is the famous bug: duplicate key value violates unique constraint "resource_calendar_key" It has to do with the unique restriction on worker for resource calendar.