cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Gentry" <blackn...@gmail.com>
Subject Re: deadlock in CayenneContext.commitChanges
Date Fri, 09 Nov 2007 15:14:22 GMT
Well, maybe Andrus won't ...

http://osdir.com/ml/java.cayenne.user/2006-09/msg00171.html

"DataContext is not thread-safe, as it is intended for access by a single user.

DataDomain and the rest of the stack underneath the DataContext is thread-safe.

If a there is a chance of multiple threads belonging to the same user
to access the context (and its DataObjects) simultaneously, you'll
have to synchronize manually.

Andrus"


On Nov 9, 2007 9:50 AM, Michael Gentry <blacknext@gmail.com> wrote:
> I don't know this for a fact, and I'm sure Andrus will correct me, but
> I would never have expected the DataContext to be thread-safe.
> Perhaps that is my EOF background.  I believe that doing commits (or
> queries) from two different DataContexts is thread-safe, though.
>
> /dev/mrg
>
>
>
> On Nov 9, 2007 5:00 AM, Aristedes Maniatis <ari@ish.com.au> wrote:
> > I was able to create a deadlock between two threads committing to the
> > same context today. Cayenne as of svn trunk yesterday. Are contexts
> > not thread-safe for writing or is this a bug?
> >
> >
> > [java] -- Thread Foxtrot Single Worker Thread #3 (Id = 39) BLOCKED
> > org.apache.cayenne.event.DispatchQueue@18c8aa
> > [java] --
> > org
> > .apache.cayenne.event.DispatchQueue.dispatchEvent(DispatchQueue.java:54)
> > [java] --
> > org.apache.cayenne.event.EventManager.dispatchEvent(EventManager.java:
> > 348)
> > [java] --
> > org.apache.cayenne.event.EventManager.postEvent(EventManager.java:319)
> > [java] --
> > org.apache.cayenne.remote.ClientChannel.onSync(ClientChannel.java:215)
> > [java] --
> > org.apache.cayenne.CayenneContext.doCommitChanges(CayenneContext.java:
> > 249)
> > [java] --
> > org.apache.cayenne.CayenneContext.commitChanges(CayenneContext.java:208)
> >
> >
> > [java] -- Thread AWT-EventQueue-0 (Id = 22) BLOCKED
> > org.apache.cayenne.CayenneContextGraphManager@ab0e6f
> > [java] --
> > org
> > .apache
> > .cayenne
> > .CayenneContextMergeHandler
> > .runWithEventsDisabled(CayenneContextMergeHandler.java:266)
> > [java] --
> > org
> > .apache
> > .cayenne
> > .CayenneContextMergeHandler
> > .graphFlushed(CayenneContextMergeHandler.java:81)
> > [java] -- sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source)
> > [java] --
> > sun
> > .reflect
> > .DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
> > 25)
> > [java] -- java.lang.reflect.Method.invoke(Method.java:585)
> > [java] -- org.apache.cayenne.util.Invocation.fire(Invocation.java:204)
> > [java] -- org.apache.cayenne.event.EventManager
> > $Dispatch.fire(EventManager.java:409)
> > [java] --
> > org
> > .apache.cayenne.event.DispatchQueue.dispatchEvent(DispatchQueue.java:
> > 162)
> > [java] --
> > org
> > .apache.cayenne.event.DispatchQueue.dispatchEvent(DispatchQueue.java:58)
> > [java] --
> > org.apache.cayenne.event.EventManager.dispatchEvent(EventManager.java:
> > 348)
> > [java] --
> > org.apache.cayenne.event.EventManager.postEvent(EventManager.java:319)
> > [java] --
> > org.apache.cayenne.remote.ClientChannel.onSync(ClientChannel.java:215)
> > [java] --
> > org.apache.cayenne.CayenneContext.doCommitChanges(CayenneContext.java:
> > 249)
> > [java] --
> > org.apache.cayenne.CayenneContext.commitChanges(CayenneContext.java:208)
> >
> >
> >
> > Ari Maniatis
> >
> >
> > -------------------------->
> > ish
> > http://www.ish.com.au
> > Level 1, 30 Wilson Street Newtown 2042 Australia
> > phone +61 2 9550 5001   fax +61 2 9550 4001
> > GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
> >
> >
> >
>

Mime
View raw message