Yuriy,
This is an excellent question which I have investigated repeatedly and the answer is... there is no answer.
Personally I feel, as I think you do, that unless a specific commit statement is sent a transaction should be rolled-back if the connection is closed.
However I have gone through the
JDBC spec in relation to this and there is NO default behaviour specified for this situation. I suspect the reason for this is that some DB's do it one way (commit) and some the other way (rollback) and so no agreement could be had on what the spec should say.
Again personally I find this sadly lacking. I believe this behaviour should be specified. As it is I find the entire transaction element of JDBC sadly lacking. I don't care which way it happens if my code just calls close instead of commit or rollback but I do care what happens if it is outside my control i.e. the connection socket is terminated because of a network failure.
So having said all that you best bet is to test and see what happens on your setup. (It seems to be commiting). Also be aware that behaviour with a pooled connection may be different. (I would suspect it will always commit in that circumstance)