<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to use transaction when connecting to Databricks using Simba ODBC driver in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-use-transaction-when-connecting-to-databricks-using-simba/m-p/86818#M37341</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/88514"&gt;@DBUser2&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I'm connecting to a databricks instance using Simba ODBC driver(version 2.8.0.1002). And I am able to perform read and write on the delta tables. But if I want to do some INSERT/UPDATE/DELETE operations within a transaction, I get the below error, and I am looking for advice on how to enable the databricks connection to use transactions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ERROR 41116 Simba::ODBC::Connection::SQLSetConnectAttr: [Simba][ODBC] (11470) Transactions are not supported.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;DBUser2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi DBUser2,&lt;/P&gt;&lt;P&gt;The error you’re encountering, ERROR 41116 Simba::ODBC::Connection::SQLSetConnectAttr: [Simba][ODBC] (11470) Transactions are not supported, indicates that the Simba ODBC driver does not support transactions for Databricks. This is a known limitation of the driver.&lt;/P&gt;&lt;P&gt;Workarounds and Alternatives&lt;BR /&gt;Auto-Commit Mode: Since transactions are not supported, you can rely on auto-commit mode for your operations. This means each operation (INSERT, UPDATE, DELETE) will be committed immediately without the need for explicit transaction control.&lt;BR /&gt;Batch Processing: If you need to perform multiple operations atomically, consider using batch processing techniques where you group multiple operations into a single batch and execute them together.&lt;BR /&gt;Databricks SQL: Use Databricks SQL endpoints for executing SQL queries. Databricks SQL supports ACID transactions on Delta tables, which might be more suitable for your needs.&lt;BR /&gt;Example of Auto-Commit Mode&lt;BR /&gt;Ensure that your connection string or session settings enable auto-commit mode. Here’s a pseudocode example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;import pyodbc

# Connection string with auto-commit enabled
conn_str = 'DRIVER={Simba ODBC Driver};Server=your_server;Database=your_database;UID=your_username;PWD=your_password;AutoCommit=True'
conn = pyodbc.connect(conn_str)

# Perform your operations
cursor = conn.cursor()
cursor.execute("INSERT INTO your_table (column1, column2) VALUES (value1, value2)")
cursor.execute("UPDATE your_table SET column1 = new_value WHERE condition")
cursor.execute("DELETE FROM your_table WHERE condition")

# Close the connection
conn.close()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this will help you.&lt;BR /&gt;Best regards,&lt;BR /&gt;florence023&lt;/P&gt;</description>
    <pubDate>Fri, 30 Aug 2024 09:41:37 GMT</pubDate>
    <dc:creator>florence023</dc:creator>
    <dc:date>2024-08-30T09:41:37Z</dc:date>
    <item>
      <title>How to use transaction when connecting to Databricks using Simba ODBC driver</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-use-transaction-when-connecting-to-databricks-using-simba/m-p/86491#M37321</link>
      <description>&lt;P&gt;I'm connecting to a databricks instance using Simba ODBC driver(version 2.8.0.1002). And I am able to perform read and write on the delta tables. But if I want to do some INSERT/UPDATE/DELETE operations within a transaction, I get the below error, and I am looking for advice on how to enable the databricks connection to use transactions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ERROR 41116 Simba::ODBC::Connection::SQLSetConnectAttr: [Simba][ODBC] (11470) Transactions are not supported.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;DBUser2&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 16:26:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-use-transaction-when-connecting-to-databricks-using-simba/m-p/86491#M37321</guid>
      <dc:creator>DBUser2</dc:creator>
      <dc:date>2024-08-29T16:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to use transaction when connecting to Databricks using Simba ODBC driver</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-use-transaction-when-connecting-to-databricks-using-simba/m-p/86818#M37341</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/88514"&gt;@DBUser2&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I'm connecting to a databricks instance using Simba ODBC driver(version 2.8.0.1002). And I am able to perform read and write on the delta tables. But if I want to do some INSERT/UPDATE/DELETE operations within a transaction, I get the below error, and I am looking for advice on how to enable the databricks connection to use transactions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ERROR 41116 Simba::ODBC::Connection::SQLSetConnectAttr: [Simba][ODBC] (11470) Transactions are not supported.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;DBUser2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi DBUser2,&lt;/P&gt;&lt;P&gt;The error you’re encountering, ERROR 41116 Simba::ODBC::Connection::SQLSetConnectAttr: [Simba][ODBC] (11470) Transactions are not supported, indicates that the Simba ODBC driver does not support transactions for Databricks. This is a known limitation of the driver.&lt;/P&gt;&lt;P&gt;Workarounds and Alternatives&lt;BR /&gt;Auto-Commit Mode: Since transactions are not supported, you can rely on auto-commit mode for your operations. This means each operation (INSERT, UPDATE, DELETE) will be committed immediately without the need for explicit transaction control.&lt;BR /&gt;Batch Processing: If you need to perform multiple operations atomically, consider using batch processing techniques where you group multiple operations into a single batch and execute them together.&lt;BR /&gt;Databricks SQL: Use Databricks SQL endpoints for executing SQL queries. Databricks SQL supports ACID transactions on Delta tables, which might be more suitable for your needs.&lt;BR /&gt;Example of Auto-Commit Mode&lt;BR /&gt;Ensure that your connection string or session settings enable auto-commit mode. Here’s a pseudocode example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;import pyodbc

# Connection string with auto-commit enabled
conn_str = 'DRIVER={Simba ODBC Driver};Server=your_server;Database=your_database;UID=your_username;PWD=your_password;AutoCommit=True'
conn = pyodbc.connect(conn_str)

# Perform your operations
cursor = conn.cursor()
cursor.execute("INSERT INTO your_table (column1, column2) VALUES (value1, value2)")
cursor.execute("UPDATE your_table SET column1 = new_value WHERE condition")
cursor.execute("DELETE FROM your_table WHERE condition")

# Close the connection
conn.close()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this will help you.&lt;BR /&gt;Best regards,&lt;BR /&gt;florence023&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2024 09:41:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-use-transaction-when-connecting-to-databricks-using-simba/m-p/86818#M37341</guid>
      <dc:creator>florence023</dc:creator>
      <dc:date>2024-08-30T09:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to use transaction when connecting to Databricks using Simba ODBC driver</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-use-transaction-when-connecting-to-databricks-using-simba/m-p/86883#M37355</link>
      <description>&lt;P&gt;Thanks for the information. Would you be able to give an example of batch processing using the ODBC driver? That'll be great.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;DBUser2&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2024 15:23:46 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-use-transaction-when-connecting-to-databricks-using-simba/m-p/86883#M37355</guid>
      <dc:creator>DBUser2</dc:creator>
      <dc:date>2024-08-30T15:23:46Z</dc:date>
    </item>
  </channel>
</rss>

