if set global transaction, how can I commit? I found that MySQL can set a global transaction, but can I commit in another session? refer: http://dev.mysql.com/doc/refman/5.6/en/set-transaction.html
BEGIN or START TRANSACTION initiates a transaction.  It is ended by COMMIT or ROLLBACK in the same connection.

SET TRANSACTION provides optional attributes for the transaction; it is not often used.

If you need a long-running transaction, or something that spans multiple web page invocations, you need to do it some other way.  (This is probably a common question on this forum.)