0

I am using springboot version 2.1.3 and i am using JPA repo for Pagination by extending PagingAndSortingRepository . so when ever i request from my JPA repo which is managing pagination it gives me proper response but when i check my hikari pool it always keep my pagination one request on pool.

HikariPool - Pool stats (total=50, active=21, idle=29, waiting=0)

Below is my JPA repo

    public interface APENRepo extends PagingAndSortingRepository<EnplateDetails, Long> {

    Page<EnplateDetails> findAll(Pageable paging);


    @Query(value = "SELECT * FROM enplate_transits WHERE timestamp BETWEEN :date AND :endDate ", countQuery = "SELECT count(*) FROM enplate_transits WHERE timestamp BETWEEN :date AND :endDate", nativeQuery = true)
    Page<EnplateDetails> findAllByDates(@Param("date") String date, @Param("endDate") String endDate,
            Pageable pageable);
     }

But if i try to access anything from another JPA repo it close connection by default.So if anyone has faced this issue so let me know that i can resloved this.

Hikari Config are below

spring.datasource.hikari.connectionTimeout=20000
spring.datasource.hikari.maximumPoolSize=50
spring.datasource.hikari.poolName=HikariPool
spring.datasource.hikari.idle-timeout=3000
Mandar Dharurkar
  • 267
  • 1
  • 5
  • 16
Nikhil Sharma
  • 593
  • 7
  • 23

0 Answers0