In the Python driver manager, there's a counter that keeps track of open "children" of a database/connection/statement. We can do the same thing in the R driver manager to prevent releasing a connection from under a statement (although I think the drivers generally return an error code if you try to do this). In any case, that information could be used by a wrapper like adbi to do something smarter (or give a better warning/error).
@nbenn Could you add the the motivating example that you ran into here?