Having tries to target two of these environments at the same time I can safely say the if you have to use a database etc. you end up having to write unique code for that environ
There are two major issues at play here...
Firstly, to my knowledge, only CPython has RAII - you have to close your own resources in Jython, Ironpython, etc.
And Secondly, as has been mentioned, is thread safety.