Skip to content

Fix JDBC connection lifecycle in GenericJdbcExecutor - #809

Open
harshitsingh070 wants to merge 1 commit into
apache:mainfrom
harshitsingh070:fix/generic-jdbc-connection-lifecycle
Open

Fix JDBC connection lifecycle in GenericJdbcExecutor#809
harshitsingh070 wants to merge 1 commit into
apache:mainfrom
harshitsingh070:fix/generic-jdbc-connection-lifecycle

Conversation

@harshitsingh070

Copy link
Copy Markdown
Contributor

Summary

Restore the intended JDBC connection lifecycle in GenericJdbcExecutor.

Root Cause

GenericJdbcExecutor declared a JDBC Connection, but connection initialization was commented out. The commented code also used an outdated createDatabaseDescriptor signature.

As a result, the executor's connection remained null, while the corresponding connection cleanup in dispose() was also commented out.

Changes

  • Initialize the JDBC connection using the current createDatabaseDescriptor API.
  • Use the genericjdbc configuration namespace when creating the database descriptor.
  • Close the JDBC connection in dispose().
  • Add regression tests covering connection creation and disposal.

Testing

Ran:

.\mvnw.cmd test -pl wayang-platforms/wayang-generic-jdbc -Pskip-prerequisite-check

Result:

Tests run: 4
Failures: 0
Errors: 0
Skipped: 0
BUILD SUCCESS

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.

1 participant