From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id D681F2A1BC for ; Mon, 10 Sep 2018 02:21:47 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oG318CUb4nFQ for ; Mon, 10 Sep 2018 02:21:47 -0400 (EDT) Received: from smtp58.i.mail.ru (smtp58.i.mail.ru [217.69.128.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 132AC2A157 for ; Mon, 10 Sep 2018 02:21:46 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH] box: add a method to check if transaction is open References: <1536282019-17978-1-git-send-email-roman.habibov1@yandex.ru> From: Kirill Shcherbatov Message-ID: Date: Mon, 10 Sep 2018 09:21:43 +0300 MIME-Version: 1.0 In-Reply-To: <1536282019-17978-1-git-send-email-roman.habibov1@yandex.ru> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org, Roman Khabibov Hi! Thank you for a patch. > +bool > +box_is_in_txn() > +{ > + return box_txn(); > +} 1. Your function box_is_in_txn is a copy of box_txn routine. There is not reason to introduce it. Moreover, box_txn is already exported as public API. > +- - true > +... > +-- close transaction > +box.commit(); 2. Check box.is_in_txn(); here please. > +-- gh-3518 no active transaction - false 3. Use tarantool codestyle for comments; at first, you need ticket description -- -- gh-3518: Check if transaction opened. -- > +box.is_in_txn(); > +-- start transaction 4. With a capital letter and with a dot at the end, please. Same for other comments.