Because JDBC comments as following:
Note: By default a Connection object is in auto-commit mode, which means that it automatically commits changes after executing each statement. If auto-commit mode has been disabled, the method commit must be called explicitly in order to commit changes; otherwise, database changes will not be saved.
Then, if connection in method1 close, it seems transaction will be commit or rollback, decided by con.isAutoCommit().
please tell me why transaction info from method1 can be kept after connection be closed.
I made a mistake.