How to LOCK TABLE ... do stuff ... UNLOCK TABLE with Spring Boot?
The idea is basically to extend some Repositories with custom functionality. So I got this setup, which DOES work! @MappedSuperclass abstract class MyBaseEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) var id: Int = 0 var eid: Int = 0 } interface MyRepository<T : MyBaseEntity> { @Transactional fun saveInsert(entity: T): Optional<T> } open class MyRepositoryImpl<T : MyBaseEntity> : MyRepository<T> { @Autowired private lateinit var entityManager: EntityManager @Transactional override fun saveInsert(entity: T): Optional<T> { // lock table entityManager.createNativeQuery("LOCK TAB
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.