Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Yasson » How thread safe is a Jsonb instance?(Sharing a single Jsonb instance between several threads)
How thread safe is a Jsonb instance? [message #1763644] Thu, 18 May 2017 09:59 Go to next message
Jean-François James is currently offline Jean-François JamesFriend
Messages: 5
Registered: May 2017
Junior Member
Hi, I've a question which may be more related to JSON-B in general: How thread safe is the javax.json.bind.Jsonb class? Can we we share a single instance between seveeal running threads? Are there any constrainsts ?
Re: How thread safe is a Jsonb instance? [message #1763704 is a reply to message #1763644] Thu, 18 May 2017 18:32 Go to previous messageGo to next message
Ehsan Zaery Moghaddam is currently offline Ehsan Zaery MoghaddamFriend
Messages: 8
Registered: December 2016
Junior Member

Hi Jean-François

As mentioned in JavaDocs of the Jsonb class, It's thread safe:

Quote:
All the methods in this class are safe for use by multiple concurrent threads.
Re: How thread safe is a Jsonb instance? [message #1763765 is a reply to message #1763704] Fri, 19 May 2017 11:36 Go to previous message
Jean-François James is currently offline Jean-François JamesFriend
Messages: 5
Registered: May 2017
Junior Member
Thank you, I should have read it: "For optimal use, JsonbBuilder and Jsonb instances should be reused - for a typical use-case, only one Jsonb instance is required by an application"
Previous Topic:Null OptionalInt deseralized as null
Next Topic:Marshalling error with nested class
Goto Forum:
  


Current Time: Wed Nov 14 16:14:32 GMT 2018

Powered by FUDForum. Page generated in 0.02361 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top