Return-Path: list-help: list-unsubscribe: List-Post: List-Id: Mailing-List: contact cactus-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list cactus-user@jakarta.apache.org Received: (qmail 42095 invoked by uid 99); 19 Aug 2004 10:26:43 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS X-Spam-Check-By: apache.org Received: from [212.122.43.181] (HELO zeus.rz1.connectline.net) (212.122.43.181) by apache.org (qpsmtpd/0.27.1) with ESMTP; Thu, 19 Aug 2004 03:26:39 -0700 Received: from [145.245.63.106] (gw.bas.roche.com [196.3.50.254]) by zeus.rz1.connectline.net (Postfix) with ESMTP id 4831B2B6A96 for ; Thu, 19 Aug 2004 12:25:54 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v618) In-Reply-To: <20040819.103244.74749793.suguri.kazuhito@lab.ntt.co.jp> References: <20040819.103244.74749793.suguri.kazuhito@lab.ntt.co.jp> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <3FAA5990-F1CA-11D8-9412-000A95D4944C@media-style.com> Content-Transfer-Encoding: 7bit From: Stefan Groschupf Subject: Re: ... a transaction, reset caller principal Date: Thu, 19 Aug 2004 12:26:36 +0200 To: "Cactus Users List" X-Mailer: Apple Mail (2.618) X-Virus-Checked: Checked Hi Kazuhito, thank you that helped very much! I notice a strange side effect. After closing the transaction my caller principal is reseted. So I use the authentication mechanism described in cactus doc and it working fine in my test method until i start / commit the transaction. Someone have any idea what kind of relation transactions and the caller principal have in weblogic? Thanks Stefan Am 19.08.2004 um 03:32 schrieb Kazuhito SUGURI: > Hi Stefan, > > In article , > Wed, 18 Aug 2004 18:36:31 +0200, > Stefan Groschupf wrote: > sg> [junit] Caused an ERROR > sg> [junit] [EJB:010116]Attempted to access the collection valued > sg> cmr-field, 'subscribers', for bean, 'Kit', outside the scope of a > sg> transaction. All access to the collection must be performed during > the > sg> transaction in which the collection was initially retrieved. > > As the error message says, you need to begin transaction > to access to the collection (retrived for n:n relation). > > For example, I have used codes for CMR test with JBoss like follows: > public class CmrTestCase > extends ServletTestCase > { > protected UserTransaction transaction = null; > protected beginTransaction(){ > if(transaction==null){ > transaction = > (UserTransaction)context.lookup("java:comp/env/UserTransaction"); > } > transaction.begin(); > } > protected commitTransaction(){ > if(transaction==null){ > return; > } > if(transaction.getStatus()==Status.STATUS_ACTIVE){ > transaction.commit(); > } > } > > public void testXXX(){ > beginTransaction(); > // test codes for CMR etc. > commitTransaction(); > } > } > > > Hope this helps. > ---- > Kazuhito SUGURI > mailto:suguri.kazuhito@lab.ntt.co.jp > > --------------------------------------------------------------------- > To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: cactus-user-help@jakarta.apache.org > >