>in the debugger watch: empty(alias())
The suggested watch expression was select("myAlias")==0 (forgot actual name), which could be simplified to used("myAlias"). IOW, the idea was to track whether the alias somehow gets closed at some point.
Which would be very hard to track if the code calls methods of objects created in different datasessions, though.