Re: svn commit: r604216 - /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/ apache/cayenne/CayenneContextGraphAction.java

From: Kevin Menard (kmenar..ervprise.com)
Date: Fri Dec 14 2007 - 11:29:43 EST

  • Next message: Scott Anderson (JIRA): "[JIRA] Created: (CAY-942) Generic types"

    I'm pretty sure this fixed the issue I was talking about on the user list.
    Before I go ahead and backport it to the other branches, could someone more
    familiar with the code take a quick look at the change?

    I'm a little skeptical because this strikes me as something one of the other
    ROP users would have run into at some point.

    Thanks,
    Kevin

    On 12/14/07 11:27 AM, "kmenar..pache.org" <kmenard@apache.org> wrote:

    > Author: kmenard
    > Date: Fri Dec 14 08:27:43 2007
    > New Revision: 604216
    >
    > URL: http://svn.apache.org/viewvc?rev=604216&view=rev
    > Log:
    > Fixed an issue with the ThreadLocal not being initialized for all threads.
    >
    > Modified:
    >
    > cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apac
    > he/cayenne/CayenneContextGraphAction.java
    >
    > Modified:
    > cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apac
    > he/cayenne/CayenneContextGraphAction.java
    > URL:
    > http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpub
    > lished/src/main/java/org/apache/cayenne/CayenneContextGraphAction.java?rev=604
    > 216&r1=604215&r2=604216&view=diff
    > ==============================================================================
    > ---
    > cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apac
    > he/cayenne/CayenneContextGraphAction.java (original)
    > +++
    > cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apac
    > he/cayenne/CayenneContextGraphAction.java Fri Dec 14 08:27:43 2007
    >.. -35,12 +35,14 @@
    > */
    > class CayenneContextGraphAction extends ObjectContextGraphAction {
    >
    > - ThreadLocal<Boolean> arcChangeInProcess;
    > + static final ThreadLocal<Boolean> arcChangeInProcess = new
    > ThreadLocal<Boolean>() {
    > + protected synchronized Boolean initialValue() {
    > + return Boolean.FALSE;
    > + }
    > + };
    >
    > CayenneContextGraphAction(ObjectContext context) {
    > super(context);
    > - this.arcChangeInProcess = new ThreadLocal<Boolean>();
    > - this.arcChangeInProcess.set(Boolean.FALSE);
    > }
    >
    > protected void handleArcPropertyChange(
    >
    >



    This archive was generated by hypermail 2.0.0 : Fri Dec 14 2007 - 11:30:19 EST