Hi I am using hibernate JPA with spring and mongodb and i am running my application on Glassfish-4.0.
My service class is :
@Component public class T
Using @Modifying and @Transaction fixed me
@Modifying @Query(value="DELETE FROM lock WHERE user_id = ?1" ,nativeQuery=true) void deleteByUserId(Long userId);
@Service @Transactional