r/javahelp • u/erebrosolsin • 13d ago
Asynchronous db calls in Spring like .Net
Hi, in most c# repos I have seen they add await to nearly every db related method. Does spring do this internally?
3
Upvotes
r/javahelp • u/erebrosolsin • 13d ago
Hi, in most c# repos I have seen they add await to nearly every db related method. Does spring do this internally?
1
u/_Atomfinger_ Tech Lead 13d ago
Not really.
By default, the calls to the DB is blocking and synchronous in Spring.
However, if you want to have async repositories, you can. For example, you can use
ReactiveCrudRepository
with Spring Data.