Skip to Content.
Sympa Menu

grouper-users - Re: [grouper-users] Detecting membership changes

Subject: Grouper Users - Open Discussion List

List archive

Re: [grouper-users] Detecting membership changes


Chronological Thread 
  • From: Shilen Patel <>
  • To: Chris Hyzer <>, Julio Polo <>
  • Cc: "" <>
  • Subject: Re: [grouper-users] Detecting membership changes
  • Date: Sat, 8 Oct 2011 13:27:01 +0000
  • Accept-language: en-US

Chris, this doesn't appear to be the same issue we found a few days ago.
Regardless, I'll get that fixed soon and we can release 2.0.1.

I don't think it's the same issue because of this from Julio's output:

// Duplicate entry '' for key 'PRIMARY'

I think that would seem to suggest that the membership id field in the
temp change log entry was empty. Julio, did you upgrade from 1.6 to 2.0
or did you install a fresh 2.0 database? I could see this happening if
you upgraded but didn't clear out your temp change log before upgrading.


Otherwise, if you don't mind, can you send me the results of the following
query along with the full stack trace from grouper_error.log?

select * from grouper_change_log_entry_temp e, grouper_change_log_type t
where e.change_log_type_id = t.id and (string01 is null or string01 like
'');

If this has data that you don't want to email (for instance if it's
production data), let me know and I'll give you a modified query.

Thanks!


-- Shilen


On 10/8/11 12:17 AM, "Chris Hyzer"
<>
wrote:

>Looks good to me, though there is an issue with the change log in 2.0,
>which maybe Shilen can reply and say if he thinks this is that issue. If
>there is not a workaround, I think we might need to release a 2.0.1...
>Shilen, let us know
>
>Thanks,
>Chris
>
>-----Original Message-----
>From: Julio Polo
>[mailto:]
>Sent: Friday, October 07, 2011 11:42 PM
>To: Chris Hyzer
>Cc:
>
>Subject: Re: [grouper-users] Detecting membership changes
>
>Thanks Chris. I am giving rules a try, but i get this error when I
>try to mimic the GSH test case for emailOnFlattenedMembershipRemove.
>Here's the gsh session:
>
>gsh 0% grouperSession = GrouperSession.startRootSession();
>
>gsh 1% new
>GrouperEmail().setTo("").setBody("email
>body").setSubject("email subject").send();
>// received above test email
>
>gsh 3% group = GroupFinder.findByName (
>grouperSession, "test:julio:personnel-officers" )
>
>gsh 4%
>RuleApi.emailOnFlattenedMembershipRemove(SubjectFinder.findRootSubject(),
>group,
>"",
> "Will remove ${safeSubject.emailAddress}
>from group ${groupDisplayExtension}", "template:
>testEmailGroupBodyFlattenedRemove");
>edu.internet2.middleware.grouper.attr.assign.AttributeAssign:
>AttributeAssign[id=c3c1b5b3ec7c4540a687f7956f99ec2d,action=assign,attribut
>eDefName=etc:attribute:rules:rule,
>
>group=Group[name=test:julio:personnel-officers,uuid=60e26667f2ce44d5841d9b
>e97e3d04a5]]
>
> gsh 5%
>edu.internet2.middleware.grouper.app.loader.GrouperLoader.runOnceByJobName
>(grouperSession,
>"CHANGE_LOG_changeLogTempToChangeLog");
> // Error: unable to evaluate command: Sourced file: inline
>evaluation of:
>``edu.internet2.middleware.grouper.app.loader.GrouperLoader.runOnceByJobNa
>me(group
>. . . '' : Method Invocation
>edu.internet2.middleware.grouper.app.loader.GrouperLoader.runOnceByJobName
> // See error log for full stacktrace
> // caused by: java.lang.RuntimeException:
> // edu.internet2.middleware.grouper.internal.dao.GrouperDAOException:
>Problem in HibernateSession: HibernateSession: isNew: false,
>isReadonly: false, grouperTransactionType: READ_WRITE_NEW,
> Exception in saveOrUpdate:
>edu.internet2.middleware.grouper.pit.PITMembership, ByObjectStatic,
>query: ', cacheable: null, cacheRegion: null, entityName: null, tx
>type: null,
> Problem in HibernateSession: HibernateSession: isNew: true,
>isReadonly: false, grouperTransactionType: READ_WRITE_NEW
> // caused by:
>edu.internet2.middleware.grouper.internal.dao.GrouperDAOException:
> // Problem in HibernateSession: HibernateSession: isNew: false,
>isReadonly: false, grouperTransactionType: READ_WRITE_NEW,
> Exception in saveOrUpdate:
>edu.internet2.middleware.grouper.pit.PITMembership, ByObjectStatic,
>query: ', cacheable: null, cacheRegion: null, entityName: null, tx
>type: null,
> Problem in HibernateSession: HibernateSession: isNew: true,
>isReadonly: false, grouperTransactionType: READ_WRITE_NEW
> // caused by: org.hibernate.exception.ConstraintViolationException:
> // Could not execute JDBC batch update,
> Exception in save:
>edu.internet2.middleware.grouper.pit.PITMembership,
>edu.internet2.middleware.grouper.hibernate.ByObject@715d1298
> // caused by: java.sql.BatchUpdateException:
> // Duplicate entry '' for key 'PRIMARY'
>
>
>We recently installed this instance of Grouper 2.0. the
>grouper-loader.properties shows this:
>
>#rules consumer, needed for some of the Grouper rule types to run
>(e.g. flattenedMembershipRemove, flattenedMembershipAdd)
>changeLog.consumer.grouperRules.class =
>edu.internet2.middleware.grouper.changeLog.esb.consumer.RuleConsumer
>changeLog.consumer.grouperRules.quartzCron =
>
>and changeLog is enabled in grouper.properties.
>
>What did we miss?
>
>Julio Polo
>Identity and Access Management
>University of Hawaii
>
>
>
>On Fri, Oct 7, 2011 at 10:32 AM, Chris Hyzer
><>
>wrote:
>> We have the last membership changed in the DB, but we don't expose over
>>WS, I supposed we could in a later version.
>>
>> If you have 2.0, there is a rule for email notifications:
>>
>>
>>https://spaces.internet2.edu/display/Grouper/Grouper+rules+use+case+-+Ema
>>il+notification+on+flattened+membership+remove
>>
>> You could need a rule for add, and a rule for remove. Note you can
>>have this work for all groups in a folder with one rule.
>>
>> Also, (applies to pre-2.0), you could use the change log to send an
>>event somewhere (e.g. xmpp or ws), or send them email directly from the
>>change log consumer. This would be very easy to setup and I could send
>>you a code example if you need it. Just send me the exact requirements.
>>
>> Generally the architecture of the change log allows us to avoid polling
>>via ws (has the membership changed? Has the membership changed? Has
>>the memberships changed? Etc) which is why it might not be ideal to add
>>to the WS api :)
>>
>> Thanks,
>> Chris
>>
>> -----Original Message-----
>> From:
>>
>>[mailto:]
>> On Behalf Of Julio Polo
>> Sent: Friday, October 07, 2011 4:05 PM
>> To:
>>
>> Subject: [grouper-users] Detecting membership changes
>>
>> Is there a web service for detecting whether members have been added
>> or removed from a group? I'm contemplating an application that sends
>> us email whenever someone is added or removed from a group. Is the
>> audit functionality the best way to achieve this? I didn't see a web
>> service for it, though. Or shall we just do a periodic dump of the
>> entire membership and diff for changes?
>>
>> Julio Polo
>> Identity and Access Management
>> University of Hawaii
>>




Archive powered by MHonArc 2.6.16.

Top of Page