QueryRunner的问题!为什么不会回滚呀?


Connection connection = null;
        try {
            QueryRunner qr = new QueryRunner();
            connection=JdbcUtils.getConnection();
            connection.setAutoCommit(false);
            String sql1 = "insert into admin_users (mobile,password) value ('dfdfdf','xxxxx')";
            qr.update(connection, sql1);
            String sql = "UPDATE admin_users SET remember_token=?,last_login_at=? where id=?";
            qr.update(connection, sql, usersBean.getRemember_token(), System.currentTimeMillis(), usersBean.getId());
            connection.commit();
            JdbcUtils.closeAll(connection,null,null);
            return true;
        } catch (SQLException throwables) {
            throwables.printStackTrace();
            try {
                assert connection != null;

                connection.rollback();
            } catch (SQLException e) {
                e.printStackTrace();
            }
            return false;
        }