Details

    • Type: Bug Fix
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0-b6, 2.0
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Rice Module:
      KRAD
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required

      Description

      Copying a permission doesn't work because the OBJ_ID gets copied, and isn't reset before attempting persistence. I suspect this will be a problem for other maint docs too.

        Attachments

          Issue Links

            Activity

            Hide
            ewestfal Eric Westfall added a comment -

            This seems like a critical bug, escalating the priority.

            Show
            ewestfal Eric Westfall added a comment - This seems like a critical bug, escalating the priority.
            Hide
            gilesp Peter Giles (Inactive) added a comment -

            Some additional info here. The following snippet from the table creation sql for krim_perm_t shows that the constraint being violated is a unique constraint on obj_id:

            CREATE TABLE `krim_perm_t` (
              `PERM_ID` varchar(40) COLLATE utf8_bin NOT NULL DEFAULT '',
              `OBJ_ID` varchar(36) COLLATE utf8_bin NOT NULL,
              `VER_NBR` decimal(8,0) NOT NULL DEFAULT '1',
              `PERM_TMPL_ID` varchar(40) COLLATE utf8_bin DEFAULT NULL,
              `NMSPC_CD` varchar(40) COLLATE utf8_bin NOT NULL,
              `NM` varchar(100) COLLATE utf8_bin NOT NULL,
              `DESC_TXT` varchar(400) COLLATE utf8_bin DEFAULT NULL,
              `ACTV_IND` varchar(1) COLLATE utf8_bin DEFAULT 'Y',
              PRIMARY KEY (`PERM_ID`),
              UNIQUE KEY `KRIM_PERM_TC0` (`OBJ_ID`),
              UNIQUE KEY `KRIM_PERM_T_TC1` (`NM`,`NMSPC_CD`),
              KEY `KRIM_PERM_TR1` (`PERM_TMPL_ID`),
              CONSTRAINT `KRIM_PERM_TR1` FOREIGN KEY (`PERM_TMPL_ID`) REFERENCES `krim_perm_tmpl_t` (`PERM_TMPL_ID`)
            )
            

            Here's the stack trace:

            2011-11-28 15:12:46,926 [TRAVEL/KSB-pool-1-thread-3] u:admin/d:3040 ERROR org.apache.ojb.broker.accesslayer.JdbcAccessImpl - 
            * SQLException during execution of sql-statement:
            * sql statement was 'INSERT INTO KRIM_PERM_T (PERM_ID,NMSPC_CD,NM,DESC_TXT,PERM_TMPL_ID,ACTV_IND,VER_NBR,OBJ_ID) VALUES (?,?,?,?,?,?,?,?) '
            * Exception message is [Duplicate entry 'AE3195EDFF2500E2E0404F8189D822AE' for key 'KRIM_PERM_TC0']
            * Vendor error code [1062]
            * SQL state code [23000=INTEGRITY CONSTRAINT VIOLATION]
            * Target class is 'org.kuali.rice.kim.impl.permission.PermissionBo'
            * PK of the target object is [id=10003]
            * Source object: org.kuali.rice.kim.impl.permission.PermissionBo@1c80b08[id=10003,namespaceCode=KR-SAP,name=Maintain KRMS Agenda,description=Allows creation and modification of agendas via the agenda editor,templateId=10001,active=true,template=org.kuali.rice.kim.impl.permission.PermissionTemplateBo@159972c[id=10001,namespaceCode=KR-RULE,name=KRMS Agenda Permission,description=View/Maintain Agenda,kimTypeId=67,active=true,versionNumber=1,objectId=AE3195EDFF2400E2E0404F8189D822AE,newCollectionRecord=false,extension=<null>],attributeDetails=[],attributes={},rolePermissions=org.springframework.util.AutoPopulatingList@1,dataDictionaryService=<null>,kimTypeInfoService=<null>,versionNumber=2,objectId=AE3195EDFF2500E2E0404F8189D822AE,newCollectionRecord=false,extension=<null>]
            * The root stack trace is --> 
            * com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'AE3195EDFF2500E2E0404F8189D822AE' for key 'KRIM_PERM_TC0'
            	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
            	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
            	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
            	at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
            	at com.mysql.jdbc.Util.getInstance(Util.java:382)
            	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1039)
            	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3603)
            	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3535)
            	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1989)
            	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2150)
            	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2626)
            	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2119)
            	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2415)
            	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2333)
            	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2318)
            	at org.enhydra.jdbc.core.CorePreparedStatement.executeUpdate(CorePreparedStatement.java:102)
            	at org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(Unknown Source)
            	at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown Source)
            	at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
            	at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
            	at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
            	at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown Source)
            	at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown Source)
            	at org.springmodules.orm.ojb.PersistenceBrokerTemplate$9.doInPersistenceBroker(PersistenceBrokerTemplate.java:246)
            	at org.springmodules.orm.ojb.PersistenceBrokerTemplate.execute(PersistenceBrokerTemplate.java:141)
            	at org.springmodules.orm.ojb.PersistenceBrokerTemplate.store(PersistenceBrokerTemplate.java:244)
            	at org.kuali.rice.krad.dao.impl.BusinessObjectDaoOjb.save(BusinessObjectDaoOjb.java:238)
            	at org.kuali.rice.krad.dao.proxy.BusinessObjectDaoProxy.save(BusinessObjectDaoProxy.java:245)
            	at sun.reflect.GeneratedMethodAccessor951.invoke(Unknown Source)
            	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            	at java.lang.reflect.Method.invoke(Method.java:597)
            	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
            	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
            	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
            	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
            	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
            	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
            	at $Proxy54.save(Unknown Source)
            	at org.kuali.rice.krad.service.impl.BusinessObjectServiceImpl.save(BusinessObjectServiceImpl.java:70)
            	at sun.reflect.GeneratedMethodAccessor950.invoke(Unknown Source)
            	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            	at java.lang.reflect.Method.invoke(Method.java:597)
            	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
            	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
            	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
            	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
            	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
            	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
            	at $Proxy55.save(Unknown Source)
            	at org.kuali.rice.kim.impl.permission.PermissionServiceImpl.createPermission(PermissionServiceImpl.java:496)
            	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)
            ...
            
            Show
            gilesp Peter Giles (Inactive) added a comment - Some additional info here. The following snippet from the table creation sql for krim_perm_t shows that the constraint being violated is a unique constraint on obj_id: CREATE TABLE `krim_perm_t` ( `PERM_ID` varchar(40) COLLATE utf8_bin NOT NULL DEFAULT '', `OBJ_ID` varchar(36) COLLATE utf8_bin NOT NULL, `VER_NBR` decimal(8,0) NOT NULL DEFAULT '1', `PERM_TMPL_ID` varchar(40) COLLATE utf8_bin DEFAULT NULL, `NMSPC_CD` varchar(40) COLLATE utf8_bin NOT NULL, `NM` varchar(100) COLLATE utf8_bin NOT NULL, `DESC_TXT` varchar(400) COLLATE utf8_bin DEFAULT NULL, `ACTV_IND` varchar(1) COLLATE utf8_bin DEFAULT 'Y', PRIMARY KEY (`PERM_ID`), UNIQUE KEY `KRIM_PERM_TC0` (`OBJ_ID`), UNIQUE KEY `KRIM_PERM_T_TC1` (`NM`,`NMSPC_CD`), KEY `KRIM_PERM_TR1` (`PERM_TMPL_ID`), CONSTRAINT `KRIM_PERM_TR1` FOREIGN KEY (`PERM_TMPL_ID`) REFERENCES `krim_perm_tmpl_t` (`PERM_TMPL_ID`) ) Here's the stack trace: 2011-11-28 15:12:46,926 [TRAVEL/KSB-pool-1-thread-3] u:admin/d:3040 ERROR org.apache.ojb.broker.accesslayer.JdbcAccessImpl - * SQLException during execution of sql-statement: * sql statement was 'INSERT INTO KRIM_PERM_T (PERM_ID,NMSPC_CD,NM,DESC_TXT,PERM_TMPL_ID,ACTV_IND,VER_NBR,OBJ_ID) VALUES (?,?,?,?,?,?,?,?) ' * Exception message is [Duplicate entry 'AE3195EDFF2500E2E0404F8189D822AE' for key 'KRIM_PERM_TC0'] * Vendor error code [1062] * SQL state code [23000=INTEGRITY CONSTRAINT VIOLATION] * Target class is 'org.kuali.rice.kim.impl.permission.PermissionBo' * PK of the target object is [id=10003] * Source object: org.kuali.rice.kim.impl.permission.PermissionBo@1c80b08[id=10003,namespaceCode=KR-SAP,name=Maintain KRMS Agenda,description=Allows creation and modification of agendas via the agenda editor,templateId=10001,active= true ,template=org.kuali.rice.kim.impl.permission.PermissionTemplateBo@159972c[id=10001,namespaceCode=KR-RULE,name=KRMS Agenda Permission,description=View/Maintain Agenda,kimTypeId=67,active= true ,versionNumber=1,objectId=AE3195EDFF2400E2E0404F8189D822AE,newCollectionRecord= false ,extension=< null >],attributeDetails=[],attributes={},rolePermissions=org.springframework.util.AutoPopulatingList@1,dataDictionaryService=< null >,kimTypeInfoService=< null >,versionNumber=2,objectId=AE3195EDFF2500E2E0404F8189D822AE,newCollectionRecord= false ,extension=< null >] * The root stack trace is --> * com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'AE3195EDFF2500E2E0404F8189D822AE' for key 'KRIM_PERM_TC0' at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:407) at com.mysql.jdbc.Util.getInstance(Util.java:382) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1039) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3603) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3535) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1989) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2150) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2626) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2119) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2415) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2333) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2318) at org.enhydra.jdbc.core.CorePreparedStatement.executeUpdate(CorePreparedStatement.java:102) at org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown Source) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown Source) at org.springmodules.orm.ojb.PersistenceBrokerTemplate$9.doInPersistenceBroker(PersistenceBrokerTemplate.java:246) at org.springmodules.orm.ojb.PersistenceBrokerTemplate.execute(PersistenceBrokerTemplate.java:141) at org.springmodules.orm.ojb.PersistenceBrokerTemplate.store(PersistenceBrokerTemplate.java:244) at org.kuali.rice.krad.dao.impl.BusinessObjectDaoOjb.save(BusinessObjectDaoOjb.java:238) at org.kuali.rice.krad.dao.proxy.BusinessObjectDaoProxy.save(BusinessObjectDaoProxy.java:245) at sun.reflect.GeneratedMethodAccessor951.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy54.save(Unknown Source) at org.kuali.rice.krad.service.impl.BusinessObjectServiceImpl.save(BusinessObjectServiceImpl.java:70) at sun.reflect.GeneratedMethodAccessor950.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy55.save(Unknown Source) at org.kuali.rice.kim.impl.permission.PermissionServiceImpl.createPermission(PermissionServiceImpl.java:496) 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) ...
            Hide
            sonam Sona Sona (Inactive) added a comment -

            When you do a copy the objectId already has a value which does not get reset and there is unique constraint on that column. This seems to be the problem with a lot of other maintainable documents also.
            Responsibility
            Namespace
            Component
            Campus
            Country
            PostalCode
            State
            Campus Type

            Show
            sonam Sona Sona (Inactive) added a comment - When you do a copy the objectId already has a value which does not get reset and there is unique constraint on that column. This seems to be the problem with a lot of other maintainable documents also. Responsibility Namespace Component Campus Country PostalCode State Campus Type
            Hide
            sonam Sona Sona (Inactive) added a comment - - edited

            I committed a fix for the other maintainable documents except responsibility. The template info and the edit/copy actions disappear when you do an edit/copy for Responsibility. Cannot test Permissions since the Edit/Copy actions do not show up for Permissions. I have created a separate jira for that.

            Show
            sonam Sona Sona (Inactive) added a comment - - edited I committed a fix for the other maintainable documents except responsibility. The template info and the edit/copy actions disappear when you do an edit/copy for Responsibility. Cannot test Permissions since the Edit/Copy actions do not show up for Permissions. I have created a separate jira for that.
            Hide
            sonam Sona Sona (Inactive) added a comment -

            Edit/Copy Responsibility has also been fixed.

            Show
            sonam Sona Sona (Inactive) added a comment - Edit/Copy Responsibility has also been fixed.
            Hide
            sonam Sona Sona (Inactive) added a comment -

            Edit/copy is now working for Permissions.

            Show
            sonam Sona Sona (Inactive) added a comment - Edit/copy is now working for Permissions.
            Hide
            jcoltrin Jessica Coltrin (Inactive) added a comment -

            Closing since these items are now in the release notes.

            Show
            jcoltrin Jessica Coltrin (Inactive) added a comment - Closing since these items are now in the release notes.

              People

              • Assignee:
                sonam Sona Sona (Inactive)
                Reporter:
                gilesp Peter Giles (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: