MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / beginTx

Method beginTx

internal/utils/dbs/batch.go:146–158  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

144}
145
146func (this *Batch) beginTx() *sql.Tx {
147 if !this.db.BeginUpdating() {
148 return nil
149 }
150
151 tx, err := this.db.Begin()
152 if err != nil {
153 this.processErr("begin transaction", err)
154 this.db.EndUpdating()
155 return nil
156 }
157 return tx
158}
159
160func (this *Batch) commitTx(tx *sql.Tx) error {
161 // always commit without checking database closing status

Callers 1

ExecMethod · 0.95

Calls 4

processErrMethod · 0.95
BeginUpdatingMethod · 0.80
EndUpdatingMethod · 0.80
BeginMethod · 0.45

Tested by

no test coverage detected