John,
PLEASE keep discussion about Turbine on the Turbine list...not the jserv-dev
list. That means that when you reply to a message, you change the To:
header. :-)
thanks,
-jon
----------
From: John McNally <[EMAIL PROTECTED]>
Reply-To: "Java-Apache Development" <[EMAIL PROTECTED]>
Date: Thu, 01 Feb 2001 10:12:21 -0800
To: Java-Apache Development <[EMAIL PROTECTED]>
Subject: Re: CVS update: turbine/conf/torque/templates/om Object.vm Peer.vm
Java Apache CVS Development wrote:
>
> Note: this method uses a
> private static variable, and there might be MT concerns here,
> since no locking is used at all.
> + static private Vector fieldNames_ = null;
> + static public Vector getFieldNames()
> + {
> + if (fieldNames_ == null)
> + {
> + fieldNames_ = new Vector();
> + #foreach ($col in $table.Columns)
> + fieldNames_.add("${col.JavaName}");
> + #end
> + }
> + return fieldNames_;
> + }
> +
I think any static initialization will finish before class methods are
executed so the following should be thread safe (ignore the cvs
characters, please)
> + static private Vector fieldNames_ = initFieldNames;
> + static public Vector getFieldNames()
> + {
> + return fieldNames_;
> + }
> +
private static Vector initFieldNames()
{
> + Vector fieldNames = new Vector();
> + #foreach ($col in $table.Columns)
> + fieldNames_.add("${col.JavaName}");
> + #end
return fieldNames;
}
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]