MorphiaOrg / MorphiaOrg/morphia
@PrePersist method not invoked sometimes
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.7k
- Forks
- 449
- Avg merge
- 7m
- Merged PRs (30d)
- 10
Description
We use @PrePersist to initialize few fields during Save of an entity.
This feature seems to be working fine most of the times. But in rare cases, this PrePersist module code is never invoked. Also we dont have the fields initialized. This leads to many processing bugs due to missing field.
- Server Version: 4.2.x
- Driver Version: 4.4.0
- Morphia Version:Using Morphia 2.2.8. [ Same issue happened in 2.2.3 as well]
@evanchooly , please suggest why this would happen. No Errors on console as well. Is there a way to track why this is skipped?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the rare save case involving @PrePersist and compare behavior across Morphia 2.2.3 and 2.2.8. The issue names no source file or test; done means determining why the callback is skipped and documenting or fixing the behavior with coverage for the failing case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, mongodb
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100