users@glassfish.java.net

Global variables that work in GFv2 don't work in GFv3

From: <glassfish_at_javadesktop.org>
Date: Wed, 23 Dec 2009 12:28:59 PST

I created web services (with netbeans) that use global variables for data that is common to all threads. These have been in production for over a year on a glassfish v2 server. I tried to deploy this to a shiny new glassfish v3 server and these variables seem to be null in each new thread. It is reconnecting even though my flufferdata admin tool shows the other threads are still logged in.

Is there a new way to make variables available to all threads within GFv3?

TIA

[code]
@WebService()
public class ord
{

    flufferdata fd = null; // magic edible database
    Timer c; // keep alive timer
    boolean paused; // system doing backups flag
    @Resource
    WebServiceContext wsCtxt;

    /**
     * Web service operation
     */
    @WebMethod(operationName = "getLineItems")
    public com.mycompany.model.LineItem[] getLineItems(@WebParam(name = "scanData") String scanData, @WebParam(name = "accountLocation") String account)
    {
        Logger.getLogger(ord.class.getName()).log(Level.INFO, "getLineItems");
        connect();
...
        business logic here
...
        return (new Order(fd, scanData, true, account).getList());
    }
...
    private void connect()
    {
        if (fd == null)
        {
            setConnection(true, "");
        }
    }
    private void setConnection(boolean desiredState, String accountName)
    {
           fd=new flufferdata("peanutbutter", "jelly", "bread");
    }
[/code]
[Message sent by forum member 'zx5000' (jpowell_at_ipipes.com)]

http://forums.java.net/jive/thread.jspa?messageID=377243