Relying on Object.finalize() to implement you Hibernate session/transaction handling is certainly not a good idea !
Start by having a look at
http://blog.hibernate.org/cgi-bin/blosxom.cgi/2004/02/18/
Then think about how can you detect and recover from any error than can occur during the tx.commit() and session.close() ...
Finally, don't forget you don't have any control on when the garbage collector will call you finalize() method. This can be long after your thread - to which your ThreadLocal session is associated - has completed its work... Hence the message you get saying your connections haven't been closed.