Skip to Content.
Sympa Menu

grouper-users - Re: [grouper-users] RegistrySubjectAttribute.addOrUpdate throws exception on change

Subject: Grouper Users - Open Discussion List

List archive

Re: [grouper-users] RegistrySubjectAttribute.addOrUpdate throws exception on change


Chronological Thread 
  • From: Michael Porter <>
  • To: Cisco ROS <>
  • Subject: Re: [grouper-users] RegistrySubjectAttribute.addOrUpdate throws exception on change
  • Date: Thu, 1 Oct 2020 10:40:23 -0400

Hi,

I forgot - I had gotten attribute changes working using HibernateSession.bySqlStatic().  Perhaps I will just use that method.

update subjectattribute set value=?, searchValue=? where subjectId=? and name=?

Thanks,

Mike

Mike Porter

(302) 831-3747



On Wed, Sep 30, 2020 at 5:34 PM Michael Porter <> wrote:
Hi,

Getting sort of random results from RegistrySubjectAttribute.addOrUpdate.  I think I've seen it work, but generally on a change, it throws an error.  In the example below, it must have worked at least once since we have an email address for the user.  But, all future updates fail.  If we are not actually updating, the call succeeds as can be seen below.

groovy:000> addSubject( "31694", "person", "Sarah M Bias" );
ERROR edu.internet2.middleware.grouper.exception.GrouperException:
subject already exists: 31694/Sarah M Bias
        at edu.internet2.middleware.grouper.RegistrySubject.add (RegistrySubject.java:145)
        at edu.internet2.middleware.grouper.RegistrySubject.add (RegistrySubject.java:105)
        at edu.internet2.middleware.grouper.app.gsh.addSubject.invoke (addSubject.java:114)
        at edu.internet2.middleware.grouper.app.gsh.addSubject$invoke.call (Unknown Source)
        at groovysh_evaluate.addSubject (groovysh_evaluate:4)
        at groovysh_evaluate.addSubject (groovysh_evaluate)
groovy:000> RegistrySubjectAttribute.addOrUpdate( "31694", "email", "" );
===> edu.internet2.middleware.grouper.RegistrySubjectAttribute@cefb56f7
groovy:000> RegistrySubjectAttribute.addOrUpdate( "31694", "email", "" );
2020-09-30 21:29:07,275: [main] ERROR BatchingBatch.performExecution(124) -  - HHH000315: Exception executing batch [Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1]
2020-09-30 21:29:07,275: [main] ERROR BatchingBatch.performExecution(124) -  - HHH000315: Exception executing batch [Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1]
2020-09-30 21:29:07,275: [main] ERROR SessionImpl$5.mapManagedFlushFailure(2994) -  - HHH000346: Error during managed flush [Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1]
2020-09-30 21:29:07,275: [main] ERROR SessionImpl$5.mapManagedFlushFailure(2994) -  - HHH000346: Error during managed flush [Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1]
ERROR edu.internet2.middleware.grouper.exception.GrouperStaleStateException:
Problem in HibernateSession: HibernateSession (498f5728): new, notReadonly, READ_WRITE_NEW, notActiveTransaction, session (3d605657)
        at edu.internet2.middleware.grouper.hibernate.HibernateSession._internal_hibernateSessionCatch (HibernateSession.java:587)
        at edu.internet2.middleware.grouper.hibernate.HibernateSession.callbackHibernateSession (HibernateSession.java:713)
        at edu.internet2.middleware.grouper.hibernate.ByObjectStatic.update (ByObjectStatic.java:199)
        at edu.internet2.middleware.grouper.internal.dao.hib3.Hib3RegistrySubjectAttributeDAO.update (Hib3RegistrySubjectAttributeDAO.java:93)
        at edu.internet2.middleware.grouper.RegistrySubjectAttribute.store (RegistrySubjectAttribute.java:240)
        at edu.internet2.middleware.grouper.RegistrySubjectAttribute.addOrUpdate (RegistrySubjectAttribute.java:283)
        at edu.internet2.middleware.grouper.RegistrySubjectAttribute$addOrUpdate.call (Unknown Source)

Thanks,

Mike

Mike Porter

(302) 831-3747



  • Re: [grouper-users] RegistrySubjectAttribute.addOrUpdate throws exception on change, Michael Porter, 10/01/2020

Archive powered by MHonArc 2.6.19.

Top of Page