0

First question:

The documentation states that you should not close the InputStream that you retrieved by the getBlob method. The javadoc of this method states, that you should close it. Who is right?

Second one:

I'm using xodus in an "asynchronous environment", where blob-streaming is suspended/resumed in a cooperative-multitasking-style using callbacks and backpressure-detection (in my specific case vertx write queues mixed with drain-handlers). So, while I'm never accessing the blob's InputStream from different Threads at the same time, I may access them from different Threads in time slots that are guaranteed to be isolated timewise from each other. Is this save?

In other words: The documentation told me that "Concurrent access" to the same blob is not possible - does this mean different Threads at the same time, or different Threads at any time?

Thank you so much for any help!

Sebastian Schmitt
  • 433
  • 1
  • 5
  • 18

1 Answers1

1

You should not close the input stream, as the documentation states. I've fixed the javadoc, thanks for noticing.

"Concurrent access" is meant as an access to a single instance of InputStream from different threads at the same time. Cooperative multitasking should work fine if the access to the stream is really successive and the happens-before order is kept.

Vyacheslav Lukianov
  • 1,913
  • 8
  • 12