I have a project on Spring boot and tried to use @Transactional and coroutines and got an error
org.springframework.dao.InvalidDataAccessApiUsageException: Executing an update/delete query; nested exception is javax.persistence.TransactionRequiredException.
Is it possible to use @Transactional and coroutines now?
override suspend fun invoke() {
val result = withContext(Dispatchers.IO) { deactivate() }
}
@Transactional
private suspend fun deactivate(): Int {
//data base call 1
//data base call 2
// ...
}