Documentation ¶
Index ¶
- Constants
- func Implement(v GlobalTransactionProxyService)
- type DefaultGlobalTransaction
- func (gtx *DefaultGlobalTransaction) Begin(ctx *context2.RootContext) error
- func (gtx *DefaultGlobalTransaction) BeginWithTimeout(timeout int32, ctx *context2.RootContext) error
- func (gtx *DefaultGlobalTransaction) BeginWithTimeoutAndName(timeout int32, name string, ctx *context2.RootContext) error
- func (gtx *DefaultGlobalTransaction) Commit(ctx *context2.RootContext) error
- func (gtx *DefaultGlobalTransaction) GetLocalStatus() meta.GlobalStatus
- func (gtx *DefaultGlobalTransaction) GetStatus(ctx *context2.RootContext) (meta.GlobalStatus, error)
- func (gtx *DefaultGlobalTransaction) GetXid(ctx *context2.RootContext) string
- func (gtx *DefaultGlobalTransaction) GlobalReport(globalStatus meta.GlobalStatus, ctx *context2.RootContext) error
- func (gtx *DefaultGlobalTransaction) Resume(suspendedResourcesHolder *SuspendedResourcesHolder, ctx *context2.RootContext) error
- func (gtx *DefaultGlobalTransaction) Rollback(ctx *context2.RootContext) error
- func (gtx *DefaultGlobalTransaction) Suspend(unbindXid bool, ctx *context2.RootContext) (*SuspendedResourcesHolder, error)
- type DefaultTransactionManager
- func (manager DefaultTransactionManager) Begin(applicationId string, transactionServiceGroup string, name string, ...) (string, error)
- func (manager DefaultTransactionManager) Commit(xid string) (meta.GlobalStatus, error)
- func (manager DefaultTransactionManager) GetStatus(xid string) (meta.GlobalStatus, error)
- func (manager DefaultTransactionManager) GlobalReport(xid string, globalStatus meta.GlobalStatus) (meta.GlobalStatus, error)
- func (manager DefaultTransactionManager) Rollback(xid string) (meta.GlobalStatus, error)
- type GlobalTransaction
- type GlobalTransactionProxyService
- type GlobalTransactionRole
- type Propagation
- type SuspendedResourcesHolder
- type TransactionInfo
- type TransactionManager
Constants ¶
View Source
const ( DEFAULT_GLOBAL_TX_TIMEOUT = 60000 DEFAULT_GLOBAL_TX_NAME = "default" )
Variables ¶
This section is empty.
Functions ¶
func Implement ¶
func Implement(v GlobalTransactionProxyService)
Types ¶
type DefaultGlobalTransaction ¶
type DefaultGlobalTransaction struct { Xid string Status meta.GlobalStatus Role GlobalTransactionRole // contains filtered or unexported fields }
func CreateNew ¶
func CreateNew() *DefaultGlobalTransaction
func GetCurrent ¶
func GetCurrent(ctx *context2.RootContext) *DefaultGlobalTransaction
func GetCurrentOrCreate ¶
func GetCurrentOrCreate(ctx *context2.RootContext) *DefaultGlobalTransaction
func (*DefaultGlobalTransaction) Begin ¶
func (gtx *DefaultGlobalTransaction) Begin(ctx *context2.RootContext) error
func (*DefaultGlobalTransaction) BeginWithTimeout ¶
func (gtx *DefaultGlobalTransaction) BeginWithTimeout(timeout int32, ctx *context2.RootContext) error
func (*DefaultGlobalTransaction) BeginWithTimeoutAndName ¶
func (gtx *DefaultGlobalTransaction) BeginWithTimeoutAndName(timeout int32, name string, ctx *context2.RootContext) error
func (*DefaultGlobalTransaction) Commit ¶
func (gtx *DefaultGlobalTransaction) Commit(ctx *context2.RootContext) error
func (*DefaultGlobalTransaction) GetLocalStatus ¶
func (gtx *DefaultGlobalTransaction) GetLocalStatus() meta.GlobalStatus
func (*DefaultGlobalTransaction) GetStatus ¶
func (gtx *DefaultGlobalTransaction) GetStatus(ctx *context2.RootContext) (meta.GlobalStatus, error)
func (*DefaultGlobalTransaction) GetXid ¶
func (gtx *DefaultGlobalTransaction) GetXid(ctx *context2.RootContext) string
func (*DefaultGlobalTransaction) GlobalReport ¶
func (gtx *DefaultGlobalTransaction) GlobalReport(globalStatus meta.GlobalStatus, ctx *context2.RootContext) error
func (*DefaultGlobalTransaction) Resume ¶
func (gtx *DefaultGlobalTransaction) Resume(suspendedResourcesHolder *SuspendedResourcesHolder, ctx *context2.RootContext) error
func (*DefaultGlobalTransaction) Rollback ¶
func (gtx *DefaultGlobalTransaction) Rollback(ctx *context2.RootContext) error
func (*DefaultGlobalTransaction) Suspend ¶
func (gtx *DefaultGlobalTransaction) Suspend(unbindXid bool, ctx *context2.RootContext) (*SuspendedResourcesHolder, error)
type DefaultTransactionManager ¶
type DefaultTransactionManager struct {
// contains filtered or unexported fields
}
func (DefaultTransactionManager) Commit ¶
func (manager DefaultTransactionManager) Commit(xid string) (meta.GlobalStatus, error)
func (DefaultTransactionManager) GetStatus ¶
func (manager DefaultTransactionManager) GetStatus(xid string) (meta.GlobalStatus, error)
func (DefaultTransactionManager) GlobalReport ¶
func (manager DefaultTransactionManager) GlobalReport(xid string, globalStatus meta.GlobalStatus) (meta.GlobalStatus, error)
func (DefaultTransactionManager) Rollback ¶
func (manager DefaultTransactionManager) Rollback(xid string) (meta.GlobalStatus, error)
type GlobalTransaction ¶
type GlobalTransaction interface { Begin(ctx *context2.RootContext) error BeginWithTimeout(timeout int32, ctx *context2.RootContext) error BeginWithTimeoutAndName(timeout int32, name string, ctx *context2.RootContext) error Commit(ctx *context2.RootContext) error Rollback(ctx *context2.RootContext) error Suspend(unbindXid bool, ctx *context2.RootContext) (*SuspendedResourcesHolder, error) Resume(suspendedResourcesHolder *SuspendedResourcesHolder, ctx *context2.RootContext) error GetStatus(ctx *context2.RootContext) (meta.GlobalStatus, error) GetXid(ctx *context2.RootContext) string GlobalReport(globalStatus meta.GlobalStatus, ctx *context2.RootContext) error GetLocalStatus() meta.GlobalStatus }
type GlobalTransactionProxyService ¶
type GlobalTransactionProxyService interface { GetProxyService() interface{} GetMethodTransactionInfo(methodName string) *TransactionInfo }
type GlobalTransactionRole ¶
type GlobalTransactionRole byte
const ( // The Launcher. The one begins the current global transaction. Launcher GlobalTransactionRole = iota // The Participant. The one just joins into a existing global transaction. Participant )
func (GlobalTransactionRole) String ¶
func (role GlobalTransactionRole) String() string
type Propagation ¶
type Propagation byte
const ( /** * The REQUIRED. */ REQUIRED Propagation = iota /** * The REQUIRES_NEW. */ REQUIRES_NEW /** * The NOT_SUPPORTED */ NOT_SUPPORTED /** * The SUPPORTS */ SUPPORTS /** * The NEVER */ NEVER /** * The MANDATORY */ MANDATORY )
func (Propagation) String ¶
func (t Propagation) String() string
type SuspendedResourcesHolder ¶
type SuspendedResourcesHolder struct {
Xid string
}
type TransactionInfo ¶
type TransactionInfo struct { TimeOut int32 Name string Propagation Propagation }
type TransactionManager ¶
type TransactionManager interface { // GlobalStatus_Begin a new global transaction. Begin(applicationId string, transactionServiceGroup string, name string, timeout int32) (string, error) // Global commit. Commit(xid string) (meta.GlobalStatus, error) // Global rollback. Rollback(xid string) (meta.GlobalStatus, error) // Get current status of the give transaction. GetStatus(xid string) (meta.GlobalStatus, error) // Global report. GlobalReport(xid string, globalStatus meta.GlobalStatus) (meta.GlobalStatus, error) }
Click to show internal directories.
Click to hide internal directories.