Bug 1037825 - Look into re-enabling threaded minhash calculation
Summary: Look into re-enabling threaded minhash calculation
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: PressGang CCMS
Classification: Community
Component: CCMS-Core
Version: 1.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 1.4
Assignee: Lee Newson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-03 21:13 UTC by Lee Newson
Modified: 2014-02-23 23:44 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-02-23 23:44:01 UTC


Attachments (Terms of Use)

Description Lee Newson 2013-12-03 21:13:06 UTC
For the 1.3 release we disabled the threaded minhash calculation due to the following error:

06:05:07,486 ERROR [org.jboss.pressgang.ccms.server.envers.LoggingRevisionListener] (Thread-87) Error occurred while looking up the Bean Manager: javax.naming.NameNotFoundException: java:comp/BeanManager
        at org.jboss.as.naming.InitialContext.findContext(InitialContext.java:198)

This looks like the cause is because the threads aren't associated with a context, so we possibly might be able to re-enable that by using the method described in http://docs.jboss.org/weld/reference/latest/en-US/html/contexts.html

Comment 1 Lee Newson 2013-12-04 04:46:15 UTC
Fixed in 1.4-SNAPSHOT build 201312041349

There were two main issues here. The first is that due to an oversight in the CDI 1.0 spec you can't access a BeanManager instance outside of EE components. This apparently will be fixed in version 1.1 of the CDI spec (see https://community.jboss.org/message/763348), so for now I've used the deltaspike implementation mentioned by Jason Porter.

The second was that because the thread had no active context, the EnversLoggingBean couldn't be used and would throw a ContextNotActiveException. As such the thread now gets associated with a RequestContext so that the EnversLoggingBean can be referenced.

Another alternative that could be used for the second part is to check if there is an active context for the EnversLoggingBean (see the beanManager.getContext() method) and if it's not active then simply skip it, as it should mean its been called from a thread and won't be supplying an log details.

Comment 2 Matthew Casperson 2014-01-27 23:42:52 UTC
I have used this same logic with the content hashes, and it has worked well.

Also tested this by deleting a number of rows from the MinHash table and regenerating them with a post to http://localhost:8080/pressgang-ccms/rest/1/minhash/recalculatemissing.


Note You need to log in before you can comment on or make changes to this bug.