Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
04-01-2019 03:06 PM
@technige could you explain just for my understanding at which point is the corresponding functionality in java driver to the 2 lifecycle functions Bolt_startup
and Bolt_shutdown
called? I assume those functions are meant to be called once per process. Does Java driver control this via a singleton which is instantiated on first driver usage? How about shutdown?
04-02-2019 08:05 AM
Hi @klobuczek,
We've using these lifecycle methods in gobolt (which wraps seabolt into a go connector), relevant source code is available lifecycle.go which are being called by the connector connector_seabolt.go#L92 and connector_seabolt.go#L61.
So, yes these are designed to be called once per process. Atomic counters would be a good way of tracking active driver instances and calling Bolt_startup
when it's incremented to 1
and Bolt_shutdown
when it's decremented to 0
would be appropriate as demonstrated in the above referenced code.
04-02-2019 08:43 AM
So in case you have multiple driver instances in a process those lifecycle methods should still be called only once?
04-04-2019 07:17 AM
Yes, that's right. It's the place where we do process wide initialization like openssl, winsocks, etc.
All the sessions of the conference are now available online