func (session *Session) ForUpdate() *Session {
	session.statement.IsForUpdate = true
	return session
}
ForUpdate Set Read/Write locking for UPDATE
package xorm
import (
	"database/sql"
	"encoding/json"
	"errors"
	"fmt"
	"hash/crc32"
	"reflect"
	"strings"
	"time"
	"github.com/go-xorm/core"
)
type Session struct {
	db                     *core.DB
	engine                 *Engine
	tx                     *core.Tx
	statement              Statement
	isAutoCommit           bool
	isCommitedOrRollbacked bool
	isAutoClose            bool
	autoResetStatement bool
	afterInsertBeans map[interface{}]*[]func(interface{})
	afterUpdateBeans map[interface{}]*[]func(interface{})
	afterDeleteBeans map[interface{}]*[]func(interface{})
	beforeClosures []func(interface{})
	afterClosures  []func(interface{})
	afterProcessors []executedProcessor
	prepareStmt bool
	stmtCache   map[uint32]*core.Stmt  
	lastSQL     string
	lastSQLArgs []interface{}
	err error
}
func (session *Session) Clone() *Session {
	var sess = *session
	return &sess
}
func (session *Session) Init() {
	session.statement.Init()
	session.statement.Engine = session.engine
	session.isAutoCommit = true
	session.isCommitedOrRollbacked = false
	session.isAutoClose = false
	session.autoResetStatement = true
	session.prepareStmt = false
	session.afterInsertBeans = make(map[interface{}]*[]func(interface{}), 0)
	session.afterUpdateBeans = make(map[interface{}]*[]func(interface{}), 0)
	session.afterDeleteBeans = make(map[interface{}]*[]func(interface{}), 0)
	session.beforeClosures = make([]func(interface{}), 0)
	session.afterClosures = make([]func(interface{}), 0)
	session.stmtCache = make(map[uint32]*core.Stmt)
	session.afterProcessors = make([]executedProcessor, 0)
	session.lastSQL = ""
	session.lastSQLArgs = []interface{}{}
}
func (session *Session) Close() {
	for _, v := range session.stmtCache {
		v.Close()
	}
	if session.db != nil {
		if session.tx != nil && !session.isCommitedOrRollbacked {
			session.Rollback()
		}
		session.tx = nil
		session.stmtCache = nil
		session.db = nil
	}
}
func (session *Session) IsClosed() bool {
	return session.db == nil
}
func (session *Session) resetStatement() {
	if session.autoResetStatement {
		session.statement.Init()
	}
}
func (session *Session) Prepare() *Session {
	session.prepareStmt = true
	return session
}
func (session *Session) Before(closures func(interface{})) *Session {
	if closures != nil {
		session.beforeClosures = append(session.beforeClosures, closures)
	}
	return session
}
func (session *Session) After(closures func(interface{})) *Session {
	if closures != nil {
		session.afterClosures = append(session.afterClosures, closures)
	}
	return session
}
func (session *Session) Table(tableNameOrBean interface{}) *Session {
	session.statement.Table(tableNameOrBean)
	return session
}
func (session *Session) Alias(alias string) *Session {
	session.statement.Alias(alias)
	return session
}
func (session *Session) NoCascade() *Session {
	session.statement.UseCascade = false
	return session
}