()
| 144 | } |
| 145 | |
| 146 | func (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 | |
| 160 | func (this *Batch) commitTx(tx *sql.Tx) error { |
| 161 | // always commit without checking database closing status |
no test coverage detected