Skip to content

Conversation

@lidavidm
Copy link
Member

@lidavidm lidavidm commented Apr 8, 2025

This avoids spamming the server-side log with "WARNING: there is no transaction in progress" messages.

Also, fix ConnectionRollback not properly starting a new transaction afterwards.

Fixes #2673.

This avoids spamming the server-side log with "WARNING:
there is no transaction in progress" messages.

Fixes apache#2673.
@lidavidm lidavidm requested a review from Copilot April 8, 2025 01:07
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 4 changed files in this pull request and generated no comments.

Files not reviewed (2)
  • c/driver/postgresql/connection.cc: Language not supported
  • c/driver/postgresql/postgresql_test.cc: Language not supported
Comments suppressed due to low confidence (1)

python/adbc_driver_postgresql/tests/test_dbapi.py:454

  • [nitpick] Consider renaming the local function 'status' to a more descriptive name like 'get_transaction_status' to improve clarity.
def status() -> str:

@lidavidm lidavidm marked this pull request as ready for review April 8, 2025 01:56
@github-actions github-actions bot added this to the ADBC Libraries 18 milestone Apr 8, 2025
Copy link
Member

@paleolimbot paleolimbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment on lines +1041 to +1049
adbc_validation::StreamReader reader;
ASSERT_THAT(AdbcStatementSetSqlQuery(&statement, "SELECT 1", &error),
IsOkStatus(&error));
ASSERT_THAT(AdbcStatementExecuteQuery(&statement, &reader.stream.value,
&reader.rows_affected, &error),
IsOkStatus(&error));
ASSERT_NO_FATAL_FAILURE(reader.GetSchema());

ASSERT_EQ("active", ConnectionGetOption(&connection, txn_status, &error));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this repeat of the above block needed to capture the issue? (If so, maybe briefly explain why somewhere?)

ASSERT_EQ("active", ConnectionGetOption(&connection, txn_status, &error));

// Note that despite the status being "active", this commit still
// generates a warning on the server.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// generates a warning on the server.
// generates a warning on the server because no changes were made to the database during the transaction.

(or the actual reason if I guessed wrong 🙂 )

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that's it, I just don't get why ROLLBACK doesn't trigger the same thing

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah...I figured it out. We need to explicitly start a new transaction after a ROLLBACK.

@lidavidm lidavidm merged commit f69b88a into apache:main Apr 14, 2025
65 of 67 checks passed
@lidavidm lidavidm deleted the gh-2673 branch April 14, 2025 00:52
colin-rogers-dbt pushed a commit to dbt-labs/arrow-adbc that referenced this pull request Jun 10, 2025
This avoids spamming the server-side log with "WARNING: there is no
transaction in progress" messages.

Also, fix ConnectionRollback not properly starting a new transaction
afterwards.

Fixes apache#2673.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pooling and conditional rollbacks

2 participants