From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NO_DNS_FOR_FROM,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by gnuweeb.org (Postfix) with ESMTPSA id 74AEF804FD for ; Fri, 28 Oct 2022 09:41:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1666950067; bh=vJc66d89Cp7y3GM/iyD8GFKx8G9yiOwcc9oaQAHxJ7U=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=uDPSQeobilbkJC/i6L4qBQn3XKhfugI0seF3B6fyqIHJ5Hh5XjhBOUJUF4qa3jLIa 3MpnRTJP6w2XPUmu/LYiWKzN3WqLtjZDzs5f2x+nYs7dw5lb7ajwJGqahipHaHPz7R k0lEtEq7wmwuzgBuYwFb5SHkFhT9mbAQajolKprKZKNwMkvxUd6Nfd0AvEeHUs82Jk D+dntQCcCZi1HoKKYqZ9LcQVGPOFMf7Fgd/u/nbeM06ibSvTZHyod5O159+fIGkCip FUrF+3h8THsMWKkB7Q2PX7qtrF+72s32hGDolgepac/OARLHIXfkTA5+fb7nDJCOUz 34R5pdqibAE3A== Received: by mail-lf1-f48.google.com with SMTP id r12so7413985lfp.1 for ; Fri, 28 Oct 2022 02:41:07 -0700 (PDT) X-Gm-Message-State: ACrzQf0UiZqrZRHtsOyxEugQat6B8yNGr9H+86NNeBxOhMi+1I5ZtD+2 a5gdjv2xvbggoApKRc6pyZ1cPuFHWdpleRBcSo0= X-Google-Smtp-Source: AMsMyM6KdBJipIspu/MrNLU+mj02VeR8JL4WJpuV1pM/TMzuRBCK3MejmoZWTr7+ORaS4h2FLBVN8ZHh+wDPzAz0jEQ= X-Received: by 2002:ac2:5551:0:b0:4a2:4014:aeb8 with SMTP id l17-20020ac25551000000b004a24014aeb8mr18913215lfk.655.1666950065519; Fri, 28 Oct 2022 02:41:05 -0700 (PDT) MIME-Version: 1.0 References: <20221027150823.601914-1-ammarfaizi2@gnuweeb.org> <20221027150823.601914-3-ammarfaizi2@gnuweeb.org> <1d500d37-b11b-75fd-38e5-d7f8e0a9b1d4@gnuweeb.org> In-Reply-To: <1d500d37-b11b-75fd-38e5-d7f8e0a9b1d4@gnuweeb.org> From: Alviro Iskandar Setiawan Date: Fri, 28 Oct 2022 16:40:54 +0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v1 2/2] daemon: telegram: Handle MySQL error To: Ammar Faizi Cc: "GNU/Weeb Mailing List" , Muhammad Rizki Content-Type: text/plain; charset="UTF-8" List-Id: On Fri, Oct 28, 2022 at 4:32 PM Ammar Faizi wrote: > On 10/28/22 4:24 PM, Alviro Iskandar Setiawan wrote: >> I think this reconnect() handling should be done in each DB method, >> not here, otherwise we'll potentially have a half-inserted data and >> may get it wrong. > > By using a transaction, such a situation cannot happen. It already > fulfills the ACID requirements. But I doubt we've fully handled that > properly. This needs extra code review, especially in that critical > section. Turning on autocommit for everything is usually a hint that you did ACID wrong, maybe not you, but Rizki. -- Viro