spring data redis version: 2.7.18
Defined Repository
public interface MemberCacheRepository extends CrudRepository<MemberPrincipal, Long> {}
refrence link: https://docs.spring.io/spring-data/redis/reference/repositories/core-concepts.html
Test
I ran the request 1000 times, and was expecting to acquire 2 connections per request.
The SQL log of hibernate per request is output as follows.
Hibernate:
update
products w
set
w.view_count = w.view_count + 1
where
w.id = ?
Hibernate:
select
product0_.id as id1_10_0_,
product0_.created_at as created_2_10_0_,
product0_.modified_at as modified3_10_0_,
product0_.address as address4_10_0_,
product0_.content as content5_10_0_,
product0_.file_name as file_nam6_10_0_,
product0_.like_count as like_cou7_10_0_,
product0_.member_id as member_i8_10_0_,
product0_.product_category as product_9_10_0_,
product0_.product_deal_at as product10_10_0_,
product0_.product_price as product11_10_0_,
product0_.product_status as product12_10_0_,
product0_.sell_status as sell_st13_10_0_,
product0_.title as title14_10_0_,
product0_.view_count as view_co15_10_0_,
member1_.id as id1_6_1_,
member1_.created_at as created_2_6_1_,
member1_.modified_at as modified3_6_1_,
member1_.account_status as account_4_6_1_,
member1_.address as address5_6_1_,
member1_.email as email6_6_1_,
member1_.file_name as file_nam7_6_1_,
member1_.flag_count as flag_cou8_6_1_,
member1_.login_type as login_ty9_6_1_,
member1_.nickname as nicknam10_6_1_,
member1_.password as passwor11_6_1_,
member1_.rating as rating12_6_1_,
member1_.user_role as user_ro13_6_1_
from
products product0_
inner join
members member1_
on product0_.member_id=member1_.id
where
product0_.id=?
However, when I monitored it, I checked that 3000 connections were acquired as below. (4 were obtained at the start of the application) The expected result is 2000 connections.
So I wanna ask if you acquire connection even if i use the repository interface.