Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
3.0
-
None
Description
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.