• 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
Re: Performance problem before and after growing WOWorkerThreads number
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Performance problem before and after growing WOWorkerThreads number


  • Subject: Re: Performance problem before and after growing WOWorkerThreads number
  • From: "Jerry W. Walker" <email@hidden>
  • Date: Tue, 12 Jun 2007 05:43:40 -0400

Hi, Benoit and Tony,

I'm concerned about the following response because it's dangerous. Here is the advice given at

http://en.wikibooks.org/wiki/Programming:WebObjects/EOF/ Using_EOF/Context_and_Database_Locking

============================================
David LeBer:

In general you are better to lock EC's in the session (if you've got one) rather than the component.

As that is the usual approach, there are a couple of solutions to implement that for you:

MultiECLockManager
Project Wonder's ERXEC
Jonathan Rochkind:

Note: One very handy (if I do say so myself) reusable solution for locking ECs you create (not neccesary for session default EC) can be found at: http://WOCode.com/cgi-bin/WebObjects/WOCode.woa/wa/ ShareCodeItem?itemId=301

Anjo Krank:

One thing to watch out for is that EC locking on the page's awake() and sleep() doesn't really work, because awake may be called more often than sleep. This means that normally you can't use DirectToWeb because it does just that. However, ProjectWonder has an editing context factory, an automatically locking and unlocking EC subclass and a lock manager that will relaese all locks when the application sleeps.

This works nicely with long response pages, provided that you don't use the session's editing context in the long running task.
============================================


Regards,
Jerry


On Jun 12, 2007, at 4:07 AM, Anthony Paras wrote:

In my apps, I've done the following in my components when I've needed a peer
editing context, and I've never had any problems:


    public EditFooInfo(WOContext context) {
        super(context);
        ec = new EOEditingContext();
    }
    public void awake() {
        super.awake();
        ec.lock();
    }
    public void sleep() {
        super.sleep();
        ec.unlock();
    }

You might want to log the locks and unlocks to see that they match up.

Also, you have so many sessions, yet you say you don't need sessions. You
could structure the app so it does not create sessions, or maybe just use
the session, and then do a...


    session().setTimeOut(1);

To make them go away quickly.

- Tony


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


This email sent to email@hidden


--
__ Jerry W. Walker,
WebObjects Developer/Instructor for High Performance Industrial Strength Internet Enabled Systems


    email@hidden
    203 278-4085        office



_______________________________________________
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


References: 
 >Re: Performance problem before and after growing WOWorkerThreads number (From: Anthony Paras <email@hidden>)

  • Prev by Date: Re: [OT] java question string parsing
  • Next by Date: Re: News from Webobjecs sessions
  • Previous by thread: Re: Performance problem before and after growing WOWorkerThreads number
  • Next by thread: Space still available: WebObjects I - Introductory Course, 6/18-6/22 in Seat
  • Index(es):
    • Date
    • Thread