title: XA transactions in Ballerina with mysql
body: <p>Tried to follow [1] using mysql instead of h2. However there seem to be issues when this is added between transaction block. Have included mysql lib under bre/lib folder. Following is the endpoint definition and transaction block. When running the .bal file after table creation a tranaction is initiated but then it directly goes to retry transaction and finally aborts it. Any idea what is missing here? [1] <a href="https://ballerina.io/learn/by-example/xa-transactions.html" rel="nofollow noreferrer">https://ballerina.io/learn/by-example/xa-transactions.html</a></p>
  
  <pre><code>endpoint mysql:Client testDB1 {
      host: "localhost",
      port: 3306,
      name: "customerdb",
      username: "root",
      password: "root",
      poolOptions: { maximumPoolSize: 5, isXA:true },
      dbOptions: { useSSL: false }
  };
  
  endpoint mysql:Client testDB2 {
      host: "localhost",
      port: 3306,
      name: "salarydb",
      username: "root",
      password: "root",
      poolOptions: { maximumPoolSize: 5, isXA:true },
      dbOptions: { useSSL: false }
  };
  
  
    transaction with retries = 3, oncommit = onCommitFunction, onabort = onAbortFunction {
        var retWithKey = testDB1-&gt;updateWithGeneratedKeys("INSERT INTO
                                  CUSTOMER(NAME) VALUES ('Anne')", ());
          string generatedKey;
          match retWithKey {
              (int, string[]) y =&gt; {
                  var (count, ids) = y;
                  generatedKey = ids[0];
                  io:println("Inserted row count: " + count);
                  io:println("Generated key: " + generatedKey);
              }
              error err =&gt; io:println("Insert to customer table failed: "
                                      + err.message);
          }
  
          ret = &lt;int&gt;generatedKey;
          int key = -1;
          match ret {
              int retInt =&gt; key = retInt;
              error err =&gt; io:println("Converting key to string failed: "
                                      + err.message);
          }
          io:println("Generated key for the inserted row: " + key);
  
          ret = testDB2-&gt;update("INSERT INTO SALARY (ID, VALUE)
                                 VALUES (?, ?)", key, 2500);
          handleUpdate(ret, "Insert to SALARY table");
  
  
     } onretry {
         io:println("Retrying transaction");
     }
  </code></pre>