• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Bug in stateless WOComponent management?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in stateless WOComponent management?


  • Subject: Bug in stateless WOComponent management?
  • From: Francis Labrie <email@hidden>
  • Date: Thu, 7 Dec 2006 10:12:57 -0500

Hi,


I have several WebObjects 5.3.2 applications deployed in production running with Java 5, and I've found something worrying with stateless components. By the way, these applications are set to allow concurrent request.

I have an heavily used stateless component managing is own bindings synchronisation:


public class Cell extends WOComponent {
// Private instance variable
private Boolean _flag;


// Code removed for clarity...
[...]


public boolean flag() {
if(_flag == null) {
// Initialize _flag to a Boolean instance: it can't be set to null
[...]
}


return _flag.booleanValue();
}


public boolean isStateless() { return true; }


public void reset() {
super.reset();


// The only place in the variable is set to null
_flag = null;
}


public boolean synchronizesVariablesWithBindings() { return false; }
}


But sometimes (less than 1% of concurrent requests), I get a NullPointerException on the "return _flag.booleanValue();" line! And this is only an evidence of the problem: sometimes I also get incorrect values. Normally, this can't be the case according to the WOComponent documentation:

<< Note that a stateless component's instance variables will remain valid for the duration of the phase (takeValuesFromRequest , invokeAction , appendToResponse ); this lets you use instance variables in the stateless components to hold things analogous to items in a WORepetition. >>

And IIRC, WebObjects use only one instance of a stateless component per thread. So I must conclude another thread called "reset()" on the same component instance, violating the WOComponent contract quoted above. This seems to be a bug in WebObjects... Can someone confirm this? Is their any workaround? I've tried to syncronize the stateless component in the appendToResponse method, but it leads to deadlocks on concurrent requests...


Kind regards,


--

Francis Labrie

Saint-Bruno-de-Montarville, Quebec, Canada


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Bug in stateless WOComponent management?
      • From: Ulrich Köster <email@hidden>
  • Prev by Date: ... has exited due to signal 10 (SIGBUS) ?
  • Next by Date: Re: Bug in stateless WOComponent management?
  • Previous by thread: ... has exited due to signal 10 (SIGBUS) ?
  • Next by thread: Re: Bug in stateless WOComponent management?
  • Index(es):
    • Date
    • Thread