在单个事务中将行插入到交错表中

kan*_*amy 5 google-cloud-platform google-cloud-spanner

我的表层次结构如下

Table A - Root level
     Table B - Child of A
     Table C - Child of A
     Table D - Child of A
Run Code Online (Sandbox Code Playgroud)

我将所有相关行插入到单个提交事务中。插入语句的顺序如下。因此,对根表的插入语句位于列表的最后。在这种情况下,我收到错误"Row [*******] in table A was already created in this transaction.

   -- Insert  B
   -- Insert  C
   -- Insert  D
   -- Insert  A
Run Code Online (Sandbox Code Playgroud)

我必须以这样的方式更改插入顺序,使根表行位于列表中的第一个,以消除错误。

显然,它表明 Commit 语句中插入语句的顺序很重要,尤其是对于交错表。但是,我在任何文档中都找不到这一点。如果这在某处有记录,有人可以指出我吗?