Skip to Content.
Sympa Menu

grouper-dev - RE: [grouper-dev] Proper way to get a Grouper Session in a Change Log Consumer

Subject: Grouper Developers Forum

List archive

RE: [grouper-dev] Proper way to get a Grouper Session in a Change Log Consumer


Chronological Thread 
  • From: Chris Hyzer <>
  • To: Misagh Moayyed <>, "" <>
  • Subject: RE: [grouper-dev] Proper way to get a Grouper Session in a Change Log Consumer
  • Date: Thu, 11 Sep 2014 18:07:26 +0000
  • Accept-language: en-US

I wouldn’t share a grouper session among threads.  Its lightweight, just create one when doing work.  It already is a threadlocal after you create it, don’t have to pass it around:

 

GrouperSession grouperSession =  GrouperSession.staticGrouperSession();

 

Thanks,

Chris

 

From: [mailto:] On Behalf Of Misagh Moayyed
Sent: Thursday, September 11, 2014 2:04 PM
To:
Subject: RE: [grouper-dev] Proper way to get a Grouper Session in a Change Log Consumer

 

Is the session threadsafe? You might want to use a ThreadLocal, if you choose the session to be a member field.

 

From: [] On Behalf Of Chris Hyzer
Sent: Thursday, September 11, 2014 11:00 AM
To: John Gasper;
Subject: RE: [grouper-dev] Proper way to get a Grouper Session in a Change Log Consumer

 

Just start one, and close in a finally block

 

    GrouperSession grouperSession = null;

   

    try {

     

      grouperSession = GrouperSession.startRootSession();

     

      //do work

     

    } finally {

      GrouperSession.stopQuietly(grouperSession);

    }

 

 

Thanks,

Chris

 

From: [] On Behalf Of John Gasper
Sent: Thursday, September 11, 2014 1:48 PM
To:
Subject: [grouper-dev] Proper way to get a Grouper Session in a Change Log Consumer

 

Hi all,

With regards to Grouper 2.2, what is the proper way to get the Grouper Session for use in a Change Log Consumer? What is more proper?  Doing a startRootSession() & close it upon every invocation of processChangeLogEntries(), or would one do something like private static GrouperSession gs & init that just once? If there is a third, better option that insight would be greatly appreciated.

Thanks,
John


---
John Gasper
IAM Consultant
Unicon, Inc.
PGP/GPG Key: 0xbafee3ef




Archive powered by MHonArc 2.6.16.

Top of Page