From commits-return-33579-apmail-tomee-commits-archive=tomee.apache.org@tomee.apache.org Wed Dec 10 07:27:12 2014 Return-Path: X-Original-To: apmail-tomee-commits-archive@www.apache.org Delivered-To: apmail-tomee-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CB3D39BA6 for ; Wed, 10 Dec 2014 07:27:12 +0000 (UTC) Received: (qmail 67956 invoked by uid 500); 10 Dec 2014 07:27:12 -0000 Delivered-To: apmail-tomee-commits-archive@tomee.apache.org Received: (qmail 67921 invoked by uid 500); 10 Dec 2014 07:27:12 -0000 Mailing-List: contact commits-help@tomee.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tomee.apache.org Delivered-To: mailing list commits@tomee.apache.org Received: (qmail 67911 invoked by uid 500); 10 Dec 2014 07:27:12 -0000 Delivered-To: apmail-openejb-commits@openejb.apache.org Received: (qmail 67908 invoked by uid 99); 10 Dec 2014 07:27:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Dec 2014 07:27:12 +0000 Date: Wed, 10 Dec 2014 07:27:12 +0000 (UTC) From: "Romain Manni-Bucau (JIRA)" To: commits@openejb.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (OPENEJB-2109) Call to ThreadContext.enter and ThreadContext.exit is uneven in EjbObjectProxyHandler.businessMethod MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/OPENEJB-2109?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Romain Manni-Bucau reassigned OPENEJB-2109: ------------------------------------------- Assignee: Romain Manni-Bucau > Call to ThreadContext.enter and ThreadContext.exit is uneven in EjbObjectProxyHandler.businessMethod > ---------------------------------------------------------------------------------------------------- > > Key: OPENEJB-2109 > URL: https://issues.apache.org/jira/browse/OPENEJB-2109 > Project: OpenEJB > Issue Type: Bug > Components: container system > Affects Versions: 4.7.1 > Environment: all platform > Reporter: chunlinyao > Assignee: Romain Manni-Bucau > Labels: Security > Fix For: 4.7.2, 5.0.0-Milestone-1 > > > When calling asynch ejb method. The ThreadContext.enter is called conditionally based on `if (threadContext != null)` but ThreadContext.exit is called conditionally based on `if (oldCtx != null)`. So If oldCtx is null, after run async ejb method, the thread will keep the ThreadContext. Next time this thread run another async ejb call, when it call ThreadContext.enter, It has an oldCtx and AbstractSecurityService will copy SecurityContext from oldCtx to new ThreadContext. Maybe ThreadContext.exit should be called conditionally based on `if (threadContext != null)`. -- This message was sent by Atlassian JIRA (v6.3.4#6332)