JdbcRespository methods Deadlock - Circular dependencies with Hazelcast getMap() in a repository setup.
See original GitHub issueMN 1.3.3 MN Data 1.0.1 Kotlin 1.3.50
Consider:
@JdbcRepository(dialect = Dialect.H2)
interface MapStoreRepository : CrudRepository<MapObjectEntity, UUID> {
fun listKey(): List<UUID>
fun deleteByKeyIn(key: List<UUID>)
}
@Singleton
class H2MapStore(
private val persistenceRepository: MapStoreRepository
) : MapStore<UUID, HazelcastCrudableObject<UUID>> {
init {
println(persistenceRepository.count())
}
...
override fun loadAllKeys(): MutableIterable<UUID> {
println(persistenceRepository.count())
val keys = persistenceRepository.listKey().toMutableList()
}
...
}
If .count() is called in init{}
then everything works when loadAllKeys() is called. If the init{} is not there, then when loadAllKeys() is called, it hangs on println(persistenceRepository.count())
, where .count() never sees to returned / blocked thread?
Issue Analytics
- State:
- Created 3 years ago
- Comments:17 (5 by maintainers)
Top Results From Across the Web
Hazelcast MapStore with Spring Boot Data JPA Circular ...
I've implemented com.hazelcast.map.MapLoader , but when I try to run the application it fails to start because of a circular dependency. It ...
Read more >micronaut-projects/micronaut-data v1.0.2 on GitHub - NewReleases.io
JdbcRespository methods Deadlock - Circular dependencies with Hazelcast getMap() in a repository setup. #464; Access to DialectResolutionInfo cannot be null ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Might help using
lazy
(https://kotlinlang.org/docs/reference/delegated-properties.html) onThis appears to be being called in the constructor which is initializing parts of hazelcast that then have a circular dependency because it comes back into your
H2MapStore
:@mmedenjak @graemerocher thank you for your assistance.