• 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: Concurrent request handling
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Concurrent request handling


  • Subject: Re: Concurrent request handling
  • From: Кушнир Геннадий <email@hidden>
  • Date: Wed, 25 May 2011 09:50:54 +0400

Hello

How could that be that session is awaken by one thread and action is
invoked by another within the same RRloop?

Are you sure that is what is happening?  Could it be that you have a bug in your session's sleep() method that is sometimes causing the EC to NOT get unlocked?
public void sleep() {
if(!isTerminating())
ecLockManager.unlock();
super.sleep();
}
I can't find any bug here ))

Can you post the thread traces?
2011-05-23 22:17:33 INFO tX47k7Qn2z0d6CXNtlL4pw Attempting to lock editing context from WorkerThread14 that was previously locked in WorkerThread3
java.lang.Exception: null
[0] net.rujel.reusables.SessionedEditingContext.lock:118
[30] net.rujel.reusables.SessionedEditingContext.saveChanges:73   // here super.saveChanges() is called
[31] net.rujel.ui.LessonNoteEditor.save:412
[32] net.rujel.ui.LessonNoteEditor.save:352
[85] net.rujel.reusables.UTF8Application.dispatchRequest:46
{java.lang.Exception: null
[0] net.rujel.reusables.SessionedEditingContext.lock:118
[1] net.rujel.reusables.MultiECLockManager.lock:66
[2] net.rujel.Session.awake:118
[9] net.rujel.reusables.UTF8Application.dispatchRequest:46}
{}

traces are filtered to include only my classes and recently active one


My first guess is that your EOEditingContext has a bug in it, and the messages you are seeing are not valid.


Chuck

I have looked through it a lot of times. And could not find any.
Maybe you could?

private String _nameOfLockingThread = null;
private NSMutableArray _stackTraces = new NSMutableArray();
private NSMutableArray _prevTraces = new NSMutableArray();

  public void lock() {
      String nameOfCurrentThread = Thread.currentThread().getName();
// prepare filtered stack trace:
      String trace = WOLogFormatter.formatTrowable(new Exception());
      if (_stackTraces.count() == 0) {
          _stackTraces.addObject(trace);
          _nameOfLockingThread = nameOfCurrentThread;
      } else {
          if (nameOfCurrentThread.equals(_nameOfLockingThread)) {
              _stackTraces.addObject(trace);
          } else {
              logger.log(WOLogLevel.INFO,
 "Attempting to lock editing context from " + nameOfCurrentThread
 + " that was previously locked in " + _nameOfLockingThread,
  new  Object[] {session,trace,_stackTraces,_prevTraces});
          }
      }
      super.lock();
  }

  public void unlock() {
      super.unlock();
      if (_stackTraces.count() > 0)
          _prevTraces.addObject(_stackTraces.removeLastObject());
      else
      _stackTraces.count();
      if (_stackTraces.count() == 0) {
          _nameOfLockingThread = null;
          _prevTraces.removeAllObjects();
      }
  }

I think those methods consist of really simple statements that should not cause problems.

---
Gennady Kushnir
 _______________________________________________
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: Concurrent request handling
      • From: Chuck Hill <email@hidden>
References: 
 >Re: Concurrent request handling (From: Gennady Kushnir <email@hidden>)
 >Re: Concurrent request handling (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: Entity With Compound PK And CLOB Field
  • Next by Date: Re: Time profiling
  • Previous by thread: Re: Concurrent request handling
  • Next by thread: Re: Concurrent request handling
  • Index(es):
    • Date
    • Thread