Skip to content

Commit 7dd9ec4

Browse files
committed
process already opened tx
1 parent 392f6b5 commit 7dd9ec4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/xsql/conn.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ func (c *conn) BeginTx(ctx context.Context, txOptions driver.TxOptions) (driver.
128128
if c.isClosed() {
129129
return nil, errClosedConn
130130
}
131+
if c.currentTx != nil {
132+
return nil, xerrors.WithStackTrace(
133+
fmt.Errorf("conn already have an opened tx: %s", c.currentTx.transaction.ID()),
134+
)
135+
}
131136
txSettings, err := isolation.ToYDB(txOptions)
132137
if err != nil {
133138
return nil, xerrors.WithStackTrace(err)

0 commit comments

Comments
 (0)