Does Java have a using statement that can be used when opening a session in hibernate?
In C# it is something like:
using (var session = new Session()
In java 8 you can use try. Please refer to following page. http://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html