-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Hope everyone from the TileDB team is well!
Recently, we've been attempting to upgrade our TileDB-Java usage from 0.10.1 to 0.17.8. When upgrading we noticed that the previous subarray functionality which used NativeBuffer instances with slicing Java primitive arrays has been replaced with a SubArray class which has many more features. Since in our usage we perform many 10s of thousands of subarray reads and writes we're pretty pedantic about cleaning up the native memory sitting behind the JNI bindings so call close() in try-with-resources blocks throughout our codebase.
When doing this on SubArray instances we noticed that the parent Array was being closed immediately:
It looks like this was added in #251. I'm not sure this was intended as this code appears to be hand rolled? If this was, could someone explain how to properly free the SubArray native resources without closing the array? It would also be nice if this close() method did not declare to be throwing a checked Exception. This appears unneeded and is also not consistent with many of the other close() methods across the codebase.