[JIRA] Created: (CAY-830) DataChannelCallbackInterceptor.onQuery NPE

From: Ari Maniatis (JIRA) ("Ari)
Date: Thu Jul 12 2007 - 04:51:28 EDT

  • Next message: Andrus Adamchik: "Re: [JIRA] Created: (CAY-830) DataChannelCallbackInterceptor.onQuery NPE"

    DataChannelCallbackInterceptor.onQuery NPE
    ------------------------------------------

                     Key: CAY-830
                     URL: https://issues.apache.org/cayenne/browse/CAY-830
                 Project: Cayenne
              Issue Type: Bug
              Components: Cayenne Core Library
        Affects Versions: 3.0
                Reporter: Ari Maniatis
                Assignee: Andrus Adamchik
                Priority: Blocker
                 Fix For: 3.0

    org.apache.cayenne.map.AshwoodEntitySorter line 309 has the line of code:
     QueryResponse response = context.getChannel().onQuery(null, query);

    However, org.apache.cayenne.intercept.DataChannelCallbackInterceptor.onQuery(ObjectContext originatingContext, Query query) assumes that originatingContext is not null. This causes an exception in our production code which looks like this:

    [java] at org.apache.cayenne.intercept.DataChannelCallbackInterceptor.onQuery(DataChannelCallbackInterceptor.java:82)
    [java] at org.apache.cayenne.map.AshwoodEntitySorter.findReflexiveMaster(AshwoodEntitySorter.java:309)
    [java] at org.apache.cayenne.map.AshwoodEntitySorter.sortObjectsForEntity(AshwoodEntitySorter.java:201)
    [java] at org.apache.cayenne.access.DataDomainDeleteBucket.appendQueriesInternal(DataDomainDeleteBucket.java:94)
    [java] at org.apache.cayenne.access.DataDomainSyncBucket.appendQueries(DataDomainSyncBucket.java:75)
    [java] at org.apache.cayenne.access.DataDomainFlushAction.preprocess(DataDomainFlushAction.java:185)
    [java] at org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAction.java:133)
    [java] at org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:786)
    [java] at org.apache.cayenne.access.DataDomain$2.transform(DataDomain.java:757)
    [java] at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:802)
    [java] at org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:754)
    [java] at org.apache.cayenne.intercept.DataChannelCallbackInterceptor.onSync(DataChannelCallbackInterceptor.java:106)
    [java] at org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1157)
    [java] at org.apache.cayenne.access.DataContext.onContextFlush(DataContext.java:1113)
    [java] at org.apache.cayenne.access.DataContext.onSync(DataContext.java:1091)
    [java] at org.apache.cayenne.access.ClientServerChannel.onSync(ClientServerChannel.java:103)
    [java] at org.apache.cayenne.intercept.DataChannelDecorator.onSync(DataChannelDecorator.java:64)
    [java] at ish.oncourse.server.cayenne.ChannelTransactionDecorator.onSync(ChannelTransactionDecorator.java:48)
    [java] at org.apache.cayenne.remote.service.DispatchHelper.dispatch(DispatchHelper.java:44)
    [java] at org.apache.cayenne.remote.service.BaseRemoteService.processMessage(BaseRemoteService.java:151)

    originatingContext needs to be wrapped to protect against nulls, but I can't see what is required.

    -- 
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.
    



    This archive was generated by hypermail 2.0.0 : Thu Jul 12 2007 - 04:51:55 EDT