MCPcopy Create free account
hub / github.com/temporalio/temporal / BeginTx

Method BeginTx

common/persistence/sql/sqlplugin/postgresql/db.go:74–85  ·  view source on GitHub ↗

BeginTx starts a new transaction and returns a reference to the Tx object

(ctx context.Context)

Source from the content-addressed store, hash-verified

72
73// BeginTx starts a new transaction and returns a reference to the Tx object
74func (pdb *db) BeginTx(ctx context.Context) (sqlplugin.Tx, error) {
75 db, err := pdb.handle.DB()
76 if err != nil {
77 // This error needs no conversion
78 return nil, err
79 }
80 tx, err := db.BeginTxx(ctx, nil)
81 if err != nil {
82 return nil, pdb.handle.ConvertError(err)
83 }
84 return newDB(pdb.dbKind, pdb.dbName, pdb.dbDriver, pdb.handle, tx, pdb.logger), nil
85}
86
87// Close closes the connection to the mysql db
88func (pdb *db) Close() error {

Callers

nothing calls this directly

Calls 3

DBMethod · 0.80
ConvertErrorMethod · 0.80
newDBFunction · 0.70

Tested by

no test coverage detected