You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: session.go
    path of file: ./repos/gim/pkg/session
    
    the code of the file until where you have to start completion: package session

import (
	"database/sql"
)

const beginStatus = 1

// SessionFactory 会话工厂
type SessionFactory struct {
	*sql.DB
}

// Session 会话
type Session struct {
	DB    
    
func (s *Session) Commit() error {
	s.rollbackSign = false
	if s.tx != nil {
		if s.commitSign == beginStatus {
			err := s.tx.Commit()
			if err != nil {
				return err
			}
			s.tx = nil
			return nil
		} else {
			s.commitSign--
		}
		return nil
	}
	return nil
}