Why SqlResource is not LazySingleton like BrokerQueryResource?
- Dominant language
- Java
- Stars
- 14.1k
- Forks
- 3.8k
- Avg merge
- 2d 58m
- Merged PRs (30d)
- 233
Description
Occasionally, I noticed SqlResource's constructor is called many times due to SqlResource is not LazySingleton.
But BrokerQueryResource is LazySingleton.
In CliBroker: `binder.bind(BrokerQueryResource.class).in(LazySingleton.class);Jerseys.addResource(binder, BrokerQueryResource.class);`
In SqlHttpModule: only `Jerseys.addResource(binder, SqlResource.class);`
Any reason why SqlResource can't be LazySingleton?
Contributor guide
Research direction
Compare the resource bindings in CliBroker and SqlHttpModule, focusing on SqlResource, BrokerQueryResource, and the Jerseys.addResource calls named in the issue. Trace SqlResource construction and its dependencies to determine whether lazy-singleton scope is safe; done means explaining the difference and applying or documenting the appropriate lifecycle consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100