jorisvandenbossche commented on PR #702:
URL: https://github.com/apache/arrow-adbc/pull/702#issuecomment-1561517815

   Another question I have here is regarding lifetime of the various objects: 
@paleolimbot mentions in https://github.com/apache/arrow-nanoarrow/pull/194 
that "the ADBC spec requires that the AdbcStatement must outlive the stream" 
(although I can't directly find something about this in the spec/docs, but 
certainly makes sense). 
   
   I can't directly get it to fail or crash by trying to consume the capsule 
after the connection/cursor when out of scope with a toy example, but should we 
try to protect against this? (instead of only documenting that the consumer 
should keep the object alive). 
   It seems that a PyCapsule has a "context" that can be set 
(https://docs.python.org/3/c-api/capsule.html#c.PyCapsule_SetContext), which 
could maybe be used for this. 
   
   Is there already some code right now to handle this? Dewey mentioned "the 
Python bindings do some reference counting to ensure that you can't release 
(say) a connection while there's still an open statement", but that's only at 
the level of adbc objects (connections, statements) and not for resulting 
streams? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to