我怎么打电话box.commit文件来自python clien

2024-09-29 19:25:44 发布

您现在位置:Python中文网/ 问答频道 /正文

我想在单个事务中执行一些代码。 我将Tarantool1.6与python客户端(0.5.4)结合使用 我的代码看起来像这样(它不工作):

import tarantool
tnt = tarantool.Connection(**params)
tnt.call('box.begin')
tnt.update(space1, 1, [('=', 2, 100)])
tnt.update(space2, 1, [('+', 1, 200)])
tnt.call('box.comit')

我有个错误:

tarantool.error.DatabaseError: (33, "Procedure 'box.comit' is not defined")

怎么了?我怎么打电话框.comit来自python?你知道吗


Tags: 代码importbox客户端updateparamscallconnection
1条回答
网友
1楼 · 发布于 2024-09-29 19:25:44

抱歉,我在代码中犯了个小错误,这个变体可以正常工作:

import tarantool
tnt = tarantool.Connection(**params)
tnt.call('box.begin')
tnt.update(space1, 1, [('=', 2, 100)])
tnt.update(space2, 1, [('+', 1, 200)])
tnt.call('box.commit')

相关问题 更多 >

    热门问题