1

This reference documentation from spring.io states claims that Spring Data JDBC supports a @Lock annotation.

Spring Data JDBC supports locking on derived query methods. To enable locking on a given derived query method inside a repository, you annotate it with @Lock.

However, I am unable to find such an annotation in the spring-data-jdbc library. There is one in the spring-data-jpa, but we use data-jdbc.

Is there a mistake in the documentation or am I missing something?

Jens Schauder
  • 77,657
  • 34
  • 181
  • 348
findusl
  • 2,454
  • 8
  • 32
  • 51

1 Answers1

1

It's org.springframework.data.relational.repository.Lock. As you can see it is in Spring Data Relational which is the basis for both Spring Data R2DBC and Spring Data JDBC.

Jens Schauder
  • 77,657
  • 34
  • 181
  • 348
  • Thanks. For some reason even though I updated the spring-data-jdbc dependency this depedency is still included in an old version. Probably due to a different spring dependency that I have to upgrade first. But now I know where to look. If you know it you could include in which version it was added, I didn't find it. It's missing in 2.3.4 and there in 2.4.5 – findusl Oct 25 '22 at 11:06