Ok I've figured out this issue.  It's not a separate thread in this case, it
just happens that there are multiple phases to the app.  When the app is
starting up it goes through a bootstrap process that was calling the same
code to insert base data as will be hit when an end user is using the web
app.  Since we're using the ShiroFilterFactoryBean to attach the security
manager to the thread it was not being bound when the bootstrap was
happening.  I've created a new thread regarding that.

On Wed, May 25, 2011 at 2:11 PM, Les Hazlewood <[email protected]>wrote:

> Is a Java Executor or ExecutorService used to dispatch its event to
> the listeners?  What 'kicks off' the Hibernate event listener thread?
>
> Also, when the event is triggered, is there identifying information
> associated with the event, such that you could inspect it and
> re-create the subject based on that identity data at that time?
>
> Finally, what do you mean by 'normal mode' vs. 'runAs' mode?  When is
> one used vs the other?  Are you using 'runAs' in the event listener?
>
> I'm happy to help - it's just a bit difficult to understand the 'flow'
> of how this works at runtime...
>
> Cheers,
>
> Les
>
> On Wed, May 25, 2011 at 7:10 AM, David Herman <[email protected]>
> wrote:
> > I've got shiro implemented and it's working quite well.  We're now trying
> to
> > implement envers to do audit logging of our entities in hibernate and
> that
> > works as well.  One problem is we're trying to get the subject making the
> > change from shiro both in normal mode and in runAs mode.  The problem is
> > that envers runs as a hibernate event listener which seems to be in a
> > separate thread.  Anyone have any suggestions on how I can bind shiro
> > properly to the thread in the newly created hibernate event?
> >
> > --

Reply via email to