Skip to content

Ensure purgeTablesBean uses the correct datasource during clean operation#134

Merged
jamesfredley merged 2 commits intoapache:2.0.xfrom
jpdev01:2.0.x
Dec 17, 2024
Merged

Ensure purgeTablesBean uses the correct datasource during clean operation#134
jamesfredley merged 2 commits intoapache:2.0.xfrom
jpdev01:2.0.x

Conversation

@jpdev01
Copy link
Copy Markdown
Contributor

@jpdev01 jpdev01 commented Dec 10, 2024

Previously, when running the clean operation, the purgeTablesBean incorrectly targeted the main application dataSource instead of the jdbcStoreDataSource specified in the Quartz properties.

This PR updates the configuration of purgeTablesBean to dynamically resolve the dataSource based on the org.quartz.jdbcStoreDataSource property. If this property is not defined, it will fallback to the default dataSource.

  • Changes:

Updated the purgeTablesBean to use properties['org.quartz.jdbcStoreDataSource'] ?: 'dataSource' for resolving the dataSource.
Ensures the clean operation now targets the correct database when jdbcStoreDataSource is provided.

  • Impact:

This fix prevents unintended operations on the main application database when a custom jdbcStoreDataSource is configured.

  • Testing:

Verified that clean operations now correctly use the jdbcStoreDataSource when specified.
Confirmed fallback to the main dataSource when org.quartz.jdbcStoreDataSource is not configured.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Dec 10, 2024

CLA assistant check
All committers have signed the CLA.

@jpdev01
Copy link
Copy Markdown
Contributor Author

jpdev01 commented Dec 10, 2024

I created the PR for version 2.0, but this issue is also present in the current version. I have opened another PR for the current version as well.

#135

@jamesfredley
Copy link
Copy Markdown
Contributor

@jpdev01 once this one gets reviewed and merged, it will get merged up to 3.0.x and 4.0.x. Do you need it on the 2.0.x branch which supports Grails 3-5? Either ways is fine, just wanted to confirm.

@arjangch can you review this change?

@jpdev01
Copy link
Copy Markdown
Contributor Author

jpdev01 commented Dec 10, 2024

@jpdev01 once this one gets reviewed and merged, it will get merged up to 3.0.x and 4.0.x. Do you need it on the 2.0.x branch which supports Grails 3-5? Either ways is fine, just wanted to confirm.

@arjangch can you review this change?

Currently, we are using version 2.0.13 of Quartz in our production application. Ideally, I would need this solution for the 2.0.x version. Is that possible?

@jamesfredley
Copy link
Copy Markdown
Contributor

@jpdev01 yes, we will do it for 2.0.x, 3.0.x and 4.0.x.

@jpdev01 jpdev01 changed the title Ensure purgeTablesBean uses the correct jdbcStoreDataSource during clean operation Ensure purgeTablesBean uses the correct datasource during clean operation Dec 12, 2024
@jamesfredley jamesfredley merged commit 3ef2b98 into apache:2.0.x Dec 17, 2024
@jamesfredley
Copy link
Copy Markdown
Contributor

#137 - merging up to 3.0.x

@jamesfredley
Copy link
Copy Markdown
Contributor

#138 merging up to 4.0.x

@jamesfredley
Copy link
Copy Markdown
Contributor

@jpdev01 @Kpotz @amondel2 @arjangch Are we ready for 2.0.14 and 3.0.1 releases which include this change?

2.0.14-SNAPSHOT, 3.0.1-SNAPSHOT and 4.0.0-SNAPSHOT have it.

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.

5 participants