Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix portNumber issue when call BaseDataSource#getUrl #14

Merged
merged 1 commit into from
Jun 23, 2023

Conversation

iskigow
Copy link

@iskigow iskigow commented Jan 24, 2023

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

web application using Spring and apache tomcat with data-source config by (apache tomcat resource) JNDI lookup

context.xml

<Resource name="jdbc/mydb"
	auth="Container"
	factory="com.zaxxer.hikari.HikariJNDIFactory"
	type="javax.sql.DataSource"
	idleTimeout="300000"
	minimumIdle="2" 
	maximumPoolSize="50"
	connectionTimeout="5000"
	leakDetectionThreshold="30000"
	dataSourceClassName="com.yugabyte.ysql.YBClusterAwareDataSource"
	dataSource.url="jdbc:yugabytedb://localhost:35433/mydb?load-balance=true"
	dataSource.user="postgres"
	dataSource.password="postgres"
	poolName="mydbDSPool"/>

MyDatasourceConfiguration.java

public class MyDatasourceConfiguration {

    @Value("${spring.datasource.jndi-name:app}")
    private String datasourceJndiName;

    @Bean
    public DataSource dataSource() throws NamingException {
        final JndiTemplate jndi = new JndiTemplate();
        return (DataSource) jndi.lookup("java:comp/env/jdbc/" + datasourceJndiName);
    }

}

When the application starts BaseDataSource#getUrl was returning

jdbc:yugabytedb://localhost/myd?adaptiveFetch=false&adaptiveFetchMaximum=-1&adaptiveFetchMinimum=0&allowEncodingChanges=false&ApplicationName=PostgreSQL+JDBC+Driver&autosave=never&binaryTransfer=true&binaryTransferDisable=&binaryTransferEnable=&cancelSignalTimeout=10&cleanupSavepoints=false&connectTimeout=10&databaseMetadataCacheFields=65536&databaseMetadataCacheFieldsMiB=5&defaultRowFetchSize=0&disableColumnSanitiser=false&escapeSyntaxCallMode=select&gssEncMode=allow&gsslib=auto&hideUnprivilegedObjects=false&hostRecheckSeconds=10&jaasLogin=true&loadBalanceHosts=false&loginTimeout=5&logServerErrorDetail=true&logUnclosedConnections=false&preferQueryMode=extended&preparedStatementCacheQueries=256&preparedStatementCacheSizeMiB=5&prepareThreshold=5&quoteReturningIdentifiers=true&readOnly=false&readOnlyMode=transaction&receiveBufferSize=-1&load-balance=true&reWriteBatchedInserts=false&sendBufferSize=-1&socketTimeout=0&sspiServiceClass=POSTGRES&targetServerType=any&tcpKeepAlive=false&tcpNoDelay=false&unknownLength=2147483647&useSpnego=false&xmlFactoryFactory=

instead:

jdbc:yugabytedb://localhost:35433/myd?adaptiveFetch=false&adaptiveFetchMaximum=-1&adaptiveFetchMinimum=0&allowEncodingChanges=false&ApplicationName=PostgreSQL+JDBC+Driver&autosave=never&binaryTransfer=true&binaryTransferDisable=&binaryTransferEnable=&cancelSignalTimeout=10&cleanupSavepoints=false&connectTimeout=10&databaseMetadataCacheFields=65536&databaseMetadataCacheFieldsMiB=5&defaultRowFetchSize=0&disableColumnSanitiser=false&escapeSyntaxCallMode=select&gssEncMode=allow&gsslib=auto&hideUnprivilegedObjects=false&hostRecheckSeconds=10&jaasLogin=true&loadBalanceHosts=false&loginTimeout=5&logServerErrorDetail=true&logUnclosedConnections=false&preferQueryMode=extended&preparedStatementCacheQueries=256&preparedStatementCacheSizeMiB=5&prepareThreshold=5&quoteReturningIdentifiers=true&readOnly=false&readOnlyMode=transaction&receiveBufferSize=-1&load-balance=true&reWriteBatchedInserts=false&sendBufferSize=-1&socketTimeout=0&sspiServiceClass=POSTGRES&targetServerType=any&tcpKeepAlive=false&tcpNoDelay=false&unknownLength=2147483647&useSpnego=false&xmlFactoryFactory=

@ashetkar
Copy link

Thanks @iskigow for the fix!

@ashetkar ashetkar merged commit 84c4262 into yugabyte:master Jun 23, 2023
apereocas-bot referenced this pull request in apereo/cas Nov 17, 2023
…v42.3.5-yb-4

[![Mend Renovate logo banner](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.yugabyte:jdbc-yugabytedb](https://www.yugabyte.com/) ([source](https://togithub.com/yugabyte/pgjdbc)) | `42.3.5-yb-3` -> `42.3.5-yb-4` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.yugabyte:jdbc-yugabytedb/42.3.5-yb-4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.yugabyte:jdbc-yugabytedb/42.3.5-yb-4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.yugabyte:jdbc-yugabytedb/42.3.5-yb-3/42.3.5-yb-4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.yugabyte:jdbc-yugabytedb/42.3.5-yb-3/42.3.5-yb-4?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>yugabyte/pgjdbc (com.yugabyte:jdbc-yugabytedb)</summary>

### [`v42.3.5-yb-4`](https://togithub.com/yugabyte/pgjdbc/releases/tag/v42.3.5-yb-4): YugabyteDB Smart JDBC Driver 42.3.5-yb-4

This driver is based on the PostgreSQL driver and forked from https://github.com/pgjdbc/pgjdbc

This release contains fixes from upstream PG JDBC driver along with the following changes:

-   Fix for the issue (Return correct port number from BaseDataSource.getUrl(), PR: [https://github.com/yugabyte/pgjdbc/pull/14](https://togithub.com/yugabyte/pgjdbc/pull/14)
-   Fix for the issue (yb-server-refresh-interval not getting picked via DataSource): https://yugabyte.atlassian.net/browse/DB-7904

Also, available on the maven coordinates:

    <dependency>
        <groupId>com.yugabyte</groupId>
        <artifactId>jdbc-yugabytedb</artifactId>
        <version>42.3.5-yb-4</version>
    </dependency>

Driver documentation link: https://docs.yugabyte.com/latest/integrations/smart-driver/

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 10pm every weekday,before 6am every weekday" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/apereo/cas).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy41OS44IiwidXBkYXRlZEluVmVyIjoiMzcuNTkuOCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9-->
leleuj referenced this pull request in leleuj/cas Nov 20, 2023
…v42.3.5-yb-4

[![Mend Renovate logo banner](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.yugabyte:jdbc-yugabytedb](https://www.yugabyte.com/) ([source](https://togithub.com/yugabyte/pgjdbc)) | `42.3.5-yb-3` -> `42.3.5-yb-4` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.yugabyte:jdbc-yugabytedb/42.3.5-yb-4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.yugabyte:jdbc-yugabytedb/42.3.5-yb-4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.yugabyte:jdbc-yugabytedb/42.3.5-yb-3/42.3.5-yb-4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.yugabyte:jdbc-yugabytedb/42.3.5-yb-3/42.3.5-yb-4?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>yugabyte/pgjdbc (com.yugabyte:jdbc-yugabytedb)</summary>

### [`v42.3.5-yb-4`](https://togithub.com/yugabyte/pgjdbc/releases/tag/v42.3.5-yb-4): YugabyteDB Smart JDBC Driver 42.3.5-yb-4

This driver is based on the PostgreSQL driver and forked from https://github.com/pgjdbc/pgjdbc

This release contains fixes from upstream PG JDBC driver along with the following changes:

-   Fix for the issue (Return correct port number from BaseDataSource.getUrl(), PR: [https://github.com/yugabyte/pgjdbc/pull/14](https://togithub.com/yugabyte/pgjdbc/pull/14)
-   Fix for the issue (yb-server-refresh-interval not getting picked via DataSource): https://yugabyte.atlassian.net/browse/DB-7904

Also, available on the maven coordinates:

    <dependency>
        <groupId>com.yugabyte</groupId>
        <artifactId>jdbc-yugabytedb</artifactId>
        <version>42.3.5-yb-4</version>
    </dependency>

Driver documentation link: https://docs.yugabyte.com/latest/integrations/smart-driver/

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 10pm every weekday,before 6am every weekday" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/apereo/cas).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy41OS44IiwidXBkYXRlZEluVmVyIjoiMzcuNTkuOCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9-->
ashetkar pushed a commit that referenced this pull request Oct 4, 2024
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.

2 participants