I think the real time community is more sophisticated than enterprise developers in this area. For example pre-emption - if a higher priority request arrives, a lower priority request that holds required resources could be pre-empted, and their resource released for the high priority user. I have not supplied a priority, and a timeout to file open in any environment I have used.
I notice static types adding complexity to solutions where a closure returns values. I don't see types adding anything in this area. I do see features like closures, ThreadLocal, and aspects (AOP) helping centralize resource management.
Each use point of API's like java.sql and java.io must manage resources by calling close.
Spring lets you use many paradigms for solving these problems, including using closure like objects, annotations on functions, and helper functions for special cases.
http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/ch12s02.html#jdbc-JdbcTemplatehttp://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/ch10s05.html#transaction-declarative-annotationsSolutions where a separate thread does resource cleanup, like garbage collection, have to be able to stall a thread which makes an allocation request, when resources are exhausted, and do a clean up. It seems like a complicated solution. An explicitly parallel resource server where one server processes close and open might work better.