lecousin / lc-spring-data-r2dbc

An extension of spring-data-r2dbc to provide features such as relationships, joins, cascading save/delete, lazy loading, sequence, schema generation, composite id
Apache License 2.0
48 stars 12 forks source link

Circular dependency on latest Spring version (2.6.x) #5

Closed iamceph closed 2 years ago

iamceph commented 2 years ago

Heyo, I got an Circular dependency exception while starting Spring. I am using latest Spring and Postgres, running this configuration with application.yaml.

Here is the error: https://paste.gg/p/anonymous/77b4004078a04a7cad6a346ed0b7951a

How can I solve this? Thank you.

lecousin commented 2 years ago

Hi, I can reproduce when I upgrade to the latest Spring version (2.6.x), but not with previous versions. I will provide a new version soon compatible with the latest Spring version.

lecousin commented 2 years ago

The version 0.5.0 has been released and is compatible with Spring version 2.6.1 Can you upgrade your dependency version and tell me if it solves your issue ?

iamceph commented 2 years ago

Solved the issue, thank you.

iamceph commented 2 years ago

I also want to ask, is there a way to not use the yaml file for entities?

lecousin commented 2 years ago

Currently not, the reason is that we need to modify the entity classes to implement the functionalities, and this needs to be done before the classes are loaded in the jvm. If we don't have the list of classes in this file, we would need to scan all class files present the classpath to find entities, which would slow down the application startup. So currently the choice is to keep performant startup time and to use this declaration file. I will study if there is an efficient way to do it without the file, or may be give the choice between performance or less declaration.

iamceph commented 2 years ago

Giving the choice sounds good to me, thank you :)

lecousin commented 2 years ago

The version 0.5.1 is available and the yaml file is now optional