зацените издевательство над здравым смыслом
Держать гибернейтную сессию в качестве instance member. То-то повеселимся в многопоточной среде...
for (Transaction transaction : TransactionContext.kick()) { doMyCoolStuff(transaction, other, args); andDoMore(); } for (InputStream : open(myFile)) { // do something; it will close in the end }