What if the user closes the page in the middle of a long mysql query?

What happens with a mysql query if the user just closes the page? Should I do any checks for this? I am using JPA 2.0 (EclipseLink 2.0), JSF 2.0, EJB 3.1 (lite) and Glassfish 3.1. Thanks.

0
source share
3 answers

In the database, the request will continue until completion. It is possible to kill the session executing the request, but there is a security problem with providing this feature outside the database.

+4
source

Typically, you cannot do anything to detect this or abort a running request. You are delayed by using processor time to complete the process because there is no way to interrupt the execution of a request from Java.

Why would this be a problem? What are you trying to avoid?

+2
source

In JPA, you can define the timeout that is passed to JDBC. You can also set maxResults to limit the number of rows returned.

JDBC now also provides a cancellation API (), but JPA has not yet disclosed this.

+2
source

Source: https://habr.com/ru/post/1340449/


All Articles