简体   繁体   中英

jpql delete query is active since long time

jpql delete query is active for last 4 hours. When I tried to execute the same query directly on the database console it took around 30seconds to execute.The total data to delete is maximum 100000. I have index on id. I am unable to understand. Any suggestions would be appreciated. Thanks

@Modifying
    @Query("DELETE FROM IoEntity WHERE Id = :id")
    void deleteAllById(@Param("id") UUID id);

Whenever you run a DML in your DB using SQL clients like Toad, SQL Developer etc, make sure you commit it unless auto commit is turned on in the client.

If you are doing the delete via JPA, commit will be taken care by Spring when you define @Transactional in your service method.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM