• 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
Locking and threads
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Locking and threads


  • Subject: Locking and threads
  • From: Fabrice Pipart <email@hidden>
  • Date: Tue, 7 Nov 2006 12:07:17 +0100

Hi all !

I am having troubles designing a specific need.
I would like to add a progress bar for long running tasks.
I found that ERXLongResponse and its task could be a good thing for me (more flexible than the WOLongResponsePage).

Here is what I understood from such a process :
I need to create a new editing context in the performAction since it runs in a separate thread
I need to lock it

My issue is that I want to do my long task in a child editing context (I don't want to commit changes to the db but in the child ec).
So I used this call : 
EOEditingContext ec = new EOEditingContext(childContext);

But if I lock such an editing context, I get a deadlock when my session is restored.
I am using MultiEcLockManager (at least its integrated in my code in case I want to use it ;-) ) AND ProjectWonder
Since I use project wonder I think my ECs are ERXECs (my session extends ERXSession)

I am a bit confused about all those locking issues.

I have nothing against just using ProjectWonder and its ERXEC, if I do so, do I still need to lock/unlock the ec (defaultEditingContext().lock() ?) in session's awake/sleep?
Would I have the same benefits as using MultiEcLockManager?
Does an ERXEC created from a ERXEC.newEditingContext(); call needs locking if its used in a separate thread ?
Is there anything different if the call is ERXEC.newEditingContext(childContext); ?
In general, when does an EC needs to get locked manually (supposing we have er.extensions.ERXEC.defaultAutomaticLockUnlock = false) ?

Thanks to anyone who could help !

Fabrice


www.easyshadow.com


International Corporate Consulting

Palais de la Scala

1 avenue Henri Dunant

Suite 1155

MC - 98000 Monaco


Skype: fabrice.pipart

Tel.  +377 97 98 21 04 (direct)

Fax. +377 97 70 88 07



 _______________________________________________
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: Locking and threads
      • From: Alexander Spohr <email@hidden>
  • Prev by Date: Where is the class???
  • Next by Date: Re: Locking and threads
  • Previous by thread: Where is the class???
  • Next by thread: Re: Locking and threads
  • Index(es):
    • Date
    • Thread