You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Andrus Adamchik (Jira)" <ji...@apache.org> on 2022/11/13 10:58:00 UTC

[jira] [Commented] (CAY-2774) Overriding service ordering in DI List causes DIRuntimeException

    [ https://issues.apache.org/jira/browse/CAY-2774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17633263#comment-17633263 ] 

Andrus Adamchik commented on CAY-2774:
--------------------------------------

See the fix here: https://github.com/apache/cayenne/pull/534

> Overriding service ordering in DI List causes DIRuntimeException
> ----------------------------------------------------------------
>
>                 Key: CAY-2774
>                 URL: https://issues.apache.org/jira/browse/CAY-2774
>             Project: Cayenne
>          Issue Type: Improvement
>    Affects Versions: 4.2.RC1, 5.0.M1
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>            Priority: Minor
>             Fix For: 5.0.M1
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Per CAY-2772, I just tried changing the ordering of a filter in ListBuilder<DataChannelSyncFilter> by re-binding the filter with different relative order. Essentially:
> {noformat}
> contributeSyncFilters().insertBefore(CommitLogFilter.class, TransactionFilter.class);
> contributeSyncFilters().addAfter(CommitLogFilter.class, TransactionFilter.class);
> {noformat}
> This results in a dependency cycle exception:
> {noformat}
> org.apache.cayenne.di.DIRuntimeException: Dependency cycle detected in DI container
> 	at org.apache.cayenne.di.spi.DIGraph.topSort(DIGraph.java:155)
> 	at org.apache.cayenne.di.spi.ListProvider.get(ListProvider.java:47)
> 	at org.apache.cayenne.di.spi.ListProvider.get(ListProvider.java:35)
> 	at org.apache.cayenne.di.spi.DefaultScopeProvider.get(DefaultScopeProvider.java:50)
> 	at org.apache.cayenne.di.spi.DefaultInjector.getInstance(DefaultInjector.java:139)
> 	at org.apache.cayenne.di.spi.FieldInjectingProvider.value(FieldInjectingProvider.java:103)
> {noformat}
> I think we can actually properly handle this case by removing the existing ordering, and rebinding with the new ordering.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)