Simplest thing would be a singleton guarded by some kind of lock. But I haven’t
looked at the code.
> On Feb 15, 2019, at 12:59 PM, Vladimir Sitnikov
> wrote:
>
> Julian> allocate a new object per request
>
> Josh> The Meta implementation inside of the Avatica server is a singleton,
>
> Juli
Julian> allocate a new object per request
Josh> The Meta implementation inside of the Avatica server is a singleton,
Julian, I don't think singletones can be allocated per request.
I don't think final fields of singletones can be changed on a per-request
basis.
What's your suggestion then?
I've
Common strategies for implementing servers using non-thread-safe objects: use
one object and ensure only one thread uses it at a time (the actor model),
allocate a new object per request, or (if creating an object is expensive) pool
objects and re-use them for later requests.
> On Feb 15, 2019,
Julian> Indeed, JDBC itself is not thread-safe
Just in case: CalciteRemoteDriverTest seems to be pretty sane test (it
does not use the same java.sql.Connection across multiple threads),
yet it fails with race-condition-like reasons.
I won't really want to dig into JDBC thread-safety, however that
+1 what Josh said.
Also: non-thread-safe is not necessarily a bad thing. As long as the caller
knows the limitation. Code that is written only to work single-threaded is more
efficient and has fewer bugs.
Indeed, JDBC itself is not thread-safe. It is not safe for two threads to
access the sam
The Meta implementation inside of the Avatica server is a singleton, so
yes the implementation must be threadsafe as the server will dispatch
multiple user request threads to it. The Meta implementation is largely
(by virtue of the wire API) stateless. I think the expectation should be
that all
Hi,
CalciteRemoteDriverTest seems to be very unstable at
https://builds.apache.org/job/Calcite-Master/
I guess the problem there is the test is using a single CalciteMetaImpl
object to handle all the requests.
Apparently CalciteMetaImpl is using no synchronization and it uses simple
HashMaps (Met