Spring boot running too slow for postgres 9.6

26 Views Asked by At

i had one project with apache ninja using java 8 and postgres 9.6. I needed to migrate this to spring boot only. I am using spring boot 2.5.x. but when i configured this project it is running 10x slower than apache ninja. i found jdbc connection is taking too much time to acquire and execution. in my apache project i was using

<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.1-901-1.jdbc4</version>
</dependency>

i was not able to use same in spring boot.

below is my pom.xml for spring boot


    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.5.12</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>

    <properties>
        <java.version>8</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>42.7.2</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>tomcat-jdbc</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.zaxxer</groupId>
            <artifactId>HikariCP</artifactId>
        </dependency>

just help how can i fix it so it can perform at least same like apache ninja 10x faster.

0

There are 0 best solutions below