# Cross-database transactions error message with pipeline

**URL:** <https://www.singlestore.com/forum/t/cross-database-transactions-error-message-with-pipeline/2872>\
**Category:** Connectors and Pipelines\
**Tags:** pipelines\
**Created:** [March 30, 2021, 3:35pm UTC](https://www.singlestore.com/forum/t/cross-database-transactions-error-message-with-pipeline/2872 "2021-03-30T15:35:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sim.masq](https://www.singlestore.com/forum/letter_avatar_proxy/v4/letter/s/a9a28c/32.png) [@sim.masq](https://www.singlestore.com/forum/u/sim.masq)\
**Post date:** [March 30, 2021, 3:35pm UTC](https://www.singlestore.com/forum/t/cross-database-transactions-error-message-with-pipeline/2872/1 "2021-03-30T15:35:12Z")

</div>

Hi,

I face the following issue: I created several procedures (hereafter: “sub-procedures”) to update various tables. I gathered those in one main procedure in which I call them all and I loaded data from a pipeline into that main procedure. While I can run manually without any issue each of the sub-procedures, when I start my pipeline, I keep on getting the same error message:

“Unhandled exception  
Type: ER\_MEMSQL\_FEATURE\_LOCKDOWN (1706)  
Message: Feature ‘Cross-database transactions’ is not supported by MemSQL.”

However, the problematic sub-procedure only uses one DB.

Would you have any idea on how I can run those sub-procedures individually without error but not as part of a pipeline?

Please let me know if you need more information/clarification on my problem.

Thanks a lot in advance.

---

<div class="post-metadata">

**Author:** ![hanson](https://www.singlestore.com/forum/user_avatar/www.singlestore.com/hanson/32/196_2.png) [@hanson](https://www.singlestore.com/forum/u/hanson)\
**Post date:** [March 30, 2021, 8:29pm UTC](https://www.singlestore.com/forum/t/cross-database-transactions-error-message-with-pipeline/2872/2 "2021-03-30T20:29:37Z")

</div>

Hi @sim.masq! Welcome to the forum.

Are you certain your top-level procedure is only updating one database?

Is your code using multi-statement transactions explicitly (begin/begin work, and commit)?

---

<div class="post-metadata">

**Author:** ![sim.masq](https://www.singlestore.com/forum/letter_avatar_proxy/v4/letter/s/a9a28c/32.png) [@sim.masq](https://www.singlestore.com/forum/u/sim.masq)\
**Post date:** [March 31, 2021, 7:01am UTC](https://www.singlestore.com/forum/t/cross-database-transactions-error-message-with-pipeline/2872/3 "2021-03-31T07:01:21Z")

</div>

Thanks @hanson.

Some of the procedures within the top-level procedure do indeed insert into another database. Nevertheless, in the error message I get, the Callstack mentions a procedure which uses only one DB.

I am not sure about your second question. My top-level procedure is built as follows:

CREATE OR REPLACE PROCEDURE DB\_1.TopLevelProcedure(query query(START\_PIPELINE text CHARACTER SET utf8 COLLATE utf8\_general\_ci NULL)) RETURNS void AS  
DECLARE  
BEGIN

call DB\_1.Procedure1(); - - This one inserts into a table in DB\_2  
call DB\_1.Procedure2(); - - This one updates a table in DB\_1 -\> I get the error message for that one.

call DB\_1.Procedure3();  
…

END;

---

<div class="post-metadata">

**Author:** ![hanson](https://www.singlestore.com/forum/user_avatar/www.singlestore.com/hanson/32/196_2.png) [@hanson](https://www.singlestore.com/forum/u/hanson)\
**Post date:** [April 1, 2021, 12:42am UTC](https://www.singlestore.com/forum/t/cross-database-transactions-error-message-with-pipeline/2872/4 "2021-04-01T00:42:02Z")

</div>

@sim.masq,

The entire top-level stored procedure is wrapped in a single transaction internally by SingleStore. So since the code inside it indirectly updates DB\_2 and DB\_1, it is trying to do a multi-database transaction. That is not allowed. It’s the source of the error message.

I’d recommend putting everything in one database if you can.

---

<div class="post-metadata">

**Author:** ![sim.masq](https://www.singlestore.com/forum/letter_avatar_proxy/v4/letter/s/a9a28c/32.png) [@sim.masq](https://www.singlestore.com/forum/u/sim.masq)\
**Post date:** [April 1, 2021, 9:40am UTC](https://www.singlestore.com/forum/t/cross-database-transactions-error-message-with-pipeline/2872/5 "2021-04-01T09:40:37Z")

</div>

Well I understand, but one thing I did not mention is that we have 3 instances (Dev, Acc and Prod). The same top-level stored procedure works fine in two of them (Acc and Prod) and actually it is in the Dev one that I face the issue.

So I’m a bit confused: how come I am able to update cross-DB in two instances but not in the other?

---

<div class="post-metadata">

**Author:** ![hanson](https://www.singlestore.com/forum/user_avatar/www.singlestore.com/hanson/32/196_2.png) [@hanson](https://www.singlestore.com/forum/u/hanson)\
**Post date:** [April 2, 2021, 3:22am UTC](https://www.singlestore.com/forum/t/cross-database-transactions-error-message-with-pipeline/2872/6 "2021-04-02T03:22:26Z")

</div>

All I can think of is that cross-DB updates inside the top level SP are only happening in Dev. Maybe there’s conditional logic making that happen? It’s should error if you really attempt a cross-DB update in the body of the stored proc called by pipelines.
