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

Andrus Adamchik edited comment on CAY-2774 at 11/13/22 11:06 AM:
-----------------------------------------------------------------

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


was (Author: andrus):
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: 0.5h
>  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)

Reply via email to