0

I want to execute some code in single transaction. I use tarantool 1.6 with python client (0.5.4) My code looks like this (it does'not work):

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')

I got error:

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

What's wrong? How can I call box.comit from python?

Alexander
  • 28
  • 3

1 Answers1

0

Sorry, I make small mistaske in code, this variant works fine:

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')
Alexander
  • 28
  • 3
  • Use stored procedure instead of this. `function my_update(space_1_tuple, space_2_table) box.begin() box.space.space1.update{space_1_tuple ...} -- and so on box.comit() end` – Vasiliy Soshnikov Jul 03 '16 at 16:13