yasson icon indicating copy to clipboard operation
yasson copied to clipboard

cache JsonProvider result in JsonBindingBuilder

Open Simulant87 opened this issue 5 years ago • 2 comments
trafficstars

implement ticket #333

Simulant87 avatar Nov 24 '19 11:11 Simulant87

Another complexity I just realized is that the Jsonb interface has a close() method on it, which will complicate the ability to share instances. I don't have a clean solution to this problem at the moment, but have 2 ideas in mind (neither of which are ideal)

  1. Store a reference count in our JsonBinding implementation and the count goes up once for every new shared instance that gets passed out, and the count goes down once each time close() gets called on an instance. When the count gets to 0 the instance is fully closed. This approach seems nice but it would render the performance optimization useless for the typical "get -> use -> close" scenario
  2. Allow an instance to be "reopened" after it is closed. This would be fine for the non-CDI case where close() is a no-op, but is not possible in CDI environments where beans are destroyed upon close

aguibert avatar Nov 24 '19 22:11 aguibert

Hi @Simulant87 , your build is failing on copyright job in our pipeline. Currently there is an issue with that on our side. See PR #365 . Please when this PR is merged, just rebase on it and everything should be fine.

Verdent avatar Nov 25 '19 12:11 Verdent