Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
None
-
None
-
None
Description
@RequestScoped isn't honoured (don't see new instance each request)
The services are:
- AcceptHeadersService
- CommandContext
- InteractionContext
- Scratchpad
- PublisherDispatchServiceDefault
That's a big problem... I would expect them to be instantiated (and call @PostConstruct/@PreDestroy) for each request. As it is, they seem to be singletons.
Also, these three further domain services are annotated with @RequestScoped, but also implement WithTransactionScope:
- ChangedObjectService
- QueryResultsCacheDefault
- MetricsServiceDefault
This callback is being called, so they are not memory leaking over time, but they are not thread-safe for concurrent transactions. At any rate, we should get rid of this home-grown transaction stuff and instead use Spring's @TransactionScope
~~~
Also, AcceptHeadersServiceForRest (the RO implementation) although it is annotated with @RequestScoped, seems to have its own thread-local. This could probably be removed if it can be made to be properly request-scoped.
Attachments
Issue Links
- blocks
-
CAUSEWAY-2294 Create JPA variant of JDO Book/Product/Inventory (regressiontests)
- Closed
- breaks
-
CAUSEWAY-2295 ChangedObjectsService doesn't reset enlisted pojos at end of xactn -> memory leak.
- Closed
- relates to
-
CAUSEWAY-2302 Rename WithTransactionScope interface to eg. TransactionScopeListener
- Closed
-
CAUSEWAY-2301 Docs for new InteractionScope
- Reopened