Return-Path: Delivered-To: apmail-axis-java-user-archive@www.apache.org Received: (qmail 755 invoked from network); 18 Aug 2010 22:20:58 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 18 Aug 2010 22:20:58 -0000 Received: (qmail 9099 invoked by uid 500); 18 Aug 2010 22:20:56 -0000 Delivered-To: apmail-axis-java-user-archive@axis.apache.org Received: (qmail 8972 invoked by uid 500); 18 Aug 2010 22:20:55 -0000 Mailing-List: contact java-user-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@axis.apache.org Delivered-To: mailing list java-user@axis.apache.org Received: (qmail 8960 invoked by uid 500); 18 Aug 2010 22:20:55 -0000 Delivered-To: apmail-ws-axis-user@ws.apache.org Received: (qmail 8955 invoked by uid 99); 18 Aug 2010 22:20:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Aug 2010 22:20:55 +0000 X-ASF-Spam-Status: No, hits=-0.1 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [129.176.212.47] (HELO mail10.mayo.edu) (129.176.212.47) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Aug 2010 22:20:46 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkwGADP5a0yBsNQ1/2dsb2JhbACBRJF5jRlxuEGIZIU3BIQxiCg Received: from mhro1a.mayo.edu ([129.176.212.53]) by ironport10.mayo.edu with ESMTP; 18 Aug 2010 17:20:25 -0500 Received: from msgebh11.mfad.mfroot.org (msgebh11.mayo.edu [129.176.248.64]) by mhro1a.mayo.edu with ESMTP id BT-MMP-1126819 for axis-user@ws.apache.org; Wed, 18 Aug 2010 17:20:25 -0500 Received: from msgebe11.mfad.mfroot.org ([129.176.249.83]) by msgebh11.mfad.mfroot.org with Microsoft SMTPSVC(6.0.3790.4675); Wed, 18 Aug 2010 17:20:25 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CB3F23.8E205609" Subject: Field level variables Date: Wed, 18 Aug 2010 17:20:23 -0500 Message-ID: <07C990EDDC0F6E45841CE85E11289EB703106EFA@msgebe11.mfad.mfroot.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Field level variables Thread-Index: Acs/I41x0UEKSDDMSgO5YuU6sJzppA== From: "Meeusen, Christopher W." To: X-OriginalArrivalTime: 18 Aug 2010 22:20:25.0269 (UTC) FILETIME=[8E38E650:01CB3F23] ------_=_NextPart_001_01CB3F23.8E205609 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I'm looking through some of my colleagues code and I'm noticing some field level variables declared inside one of our pojos. Something similar to this: =20 Public class classA { private classB aClassb; =20 Public classC[] aMethod() { aClassb=3D new classB(); } =20 } =20 aMethod() is exposed as a web service and is called several thousand times per minute. Is this thread safe? I know it is bad to have field level variables unless they are really needed but I don't know if this behavior is ok inside of the axis2 environment. =20 Thanks, Chris ------_=_NextPart_001_01CB3F23.8E205609 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I’m = looking through some of my colleagues code and I’m noticing some = field level variables declared inside one of our pojos.  Something = similar to this:

 

Public class = classA

{

         &= nbsp;      private classB = aClassb;

 

         &= nbsp;      Public classC[] = aMethod()

{

         &= nbsp;           &n= bsp;          aClassb=3D = new classB();

}       &nb= sp;     

}

 

aMethod() is = exposed as a web service and is called several thousand times per = minute.  Is this thread safe?  I know it is bad to have field = level variables unless they are really needed but I don’t know if = this behavior is ok inside of the axis2 environment.

 

Thanks,

Chris

------_=_NextPart_001_01CB3F23.8E205609--