Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse generated PropertyAccessor's and Entityinstantiator classes across EntityInstantiators and PersistentPropertyAccessorFactorys [DATACMNS-1602] #2032

Closed
spring-projects-issues opened this issue Oct 30, 2019 · 0 comments
Assignees
Labels
in: mapping type: enhancement

Comments

@spring-projects-issues
Copy link

spring-projects-issues commented Oct 30, 2019

Mark Paluch opened DATACMNS-1602 and commented

When creating new Template API instances without reusing a converter instance, typically EntityInstantiators and PersistentPropertyAccessorFactory get re-created. Both types hold instance caches for runtime-generated classes (ClassGeneratingPropertyAccessorFactory, ClassGeneratingEntityInstantiator). Using the same domain type with both Template API instances leads to LinkageError as the second component attempts to register a class that is already known to the class loader.

We should attempt to resolve an already loaded class when the instance-level cache misses a cache hit and we enter the code path to generate and declare a class


Issue Links:

  • DATAMONGO-2386 MongoTemplate.insert throws java.lang.LinkageError exceptions

Backported to: 2.2.1 (Moore SR1), 2.1.12 (Lovelace SR12)

@spring-projects-issues spring-projects-issues added type: enhancement in: mapping labels Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: mapping type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants