xa

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	BranchIdPrefix     = "-"
	SeataXaXidFormatId = 9752
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionProxyXA added in v1.1.0

type ConnectionProxyXA struct {
	// contains filtered or unexported fields
}

func NewConnectionProxyXA added in v1.1.0

func NewConnectionProxyXA(originalConnection sql.Conn, xaConnection XAConnection, resource sql.BaseDataSourceResource, xid string) (*ConnectionProxyXA, error)

func (*ConnectionProxyXA) Close added in v1.1.0

func (c *ConnectionProxyXA) Close() error

func (*ConnectionProxyXA) CloseForce added in v1.1.0

func (c *ConnectionProxyXA) CloseForce() error

func (*ConnectionProxyXA) Commit added in v1.1.0

func (c *ConnectionProxyXA) Commit() error

func (*ConnectionProxyXA) GetAutoCommit added in v1.1.0

func (c *ConnectionProxyXA) GetAutoCommit() bool

func (*ConnectionProxyXA) GetPrepareTime added in v1.1.0

func (c *ConnectionProxyXA) GetPrepareTime() int64

func (*ConnectionProxyXA) IsHeld added in v1.1.0

func (c *ConnectionProxyXA) IsHeld() bool

func (*ConnectionProxyXA) Rollback added in v1.1.0

func (c *ConnectionProxyXA) Rollback() error

func (*ConnectionProxyXA) SetAutoCommit added in v1.1.0

func (c *ConnectionProxyXA) SetAutoCommit(autoCommit bool) error

func (*ConnectionProxyXA) SetHeld added in v1.1.0

func (c *ConnectionProxyXA) SetHeld(kept bool)

func (*ConnectionProxyXA) ShouldBeHeld added in v1.1.0

func (c *ConnectionProxyXA) ShouldBeHeld() bool

func (*ConnectionProxyXA) XaCommit added in v1.1.0

func (c *ConnectionProxyXA) XaCommit(xid string, branchId int64) error

func (*ConnectionProxyXA) XaRollback added in v1.1.0

func (c *ConnectionProxyXA) XaRollback(xaXid XAXid) error

func (*ConnectionProxyXA) XaRollbackByBranchId added in v1.1.0

func (c *ConnectionProxyXA) XaRollbackByBranchId(xid string, branchId int64)

type Option

type Option func(*XABranchXid)

func WithBranchId

func WithBranchId(branchId int64) Option

func WithBranchQualifier

func WithBranchQualifier(branchQualifier []byte) Option

func WithGlobalTransactionId

func WithGlobalTransactionId(globalTransactionId []byte) Option

func WithXid

func WithXid(xid string) Option

type XABranchXid

type XABranchXid struct {
	// contains filtered or unexported fields
}

func Build

func Build(xid string, branchId int64) *XABranchXid

func BuildWithByte

func BuildWithByte(globalTransactionId []byte, branchQualifier []byte) *XABranchXid

func NewXABranchXid

func NewXABranchXid(opt ...Option) *XABranchXid

func (*XABranchXid) GetBranchId

func (x *XABranchXid) GetBranchId() int64

func (*XABranchXid) GetBranchQualifier

func (x *XABranchXid) GetBranchQualifier() []byte

func (*XABranchXid) GetFormatId

func (x *XABranchXid) GetFormatId() int

func (*XABranchXid) GetGlobalTransactionId

func (x *XABranchXid) GetGlobalTransactionId() []byte

func (*XABranchXid) GetGlobalXid

func (x *XABranchXid) GetGlobalXid() string

func (*XABranchXid) String

func (x *XABranchXid) String() string

type XAConnection added in v1.1.0

type XAConnection interface {
	// contains filtered or unexported methods
}

type XAXid

type XAXid interface {
	Xid
	GetGlobalXid() string
	GetBranchId() int64
}

type Xid

type Xid interface {
	GetFormatId() int
	GetGlobalTransactionId() []byte
	GetBranchQualifier() []byte
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL