W,
On 8/9/21 12:04, W wrote:
Hi,I have a web application. It is a java-jsp-tomcat-mysql. It is working, but
sometimes, it is slow. For each data update statement, it is not slow: the next
jsp page shows promptly. But the next page does not see updated data. I wait a
coupe seconds, refresh the page, the updated date shows. Each connection is
from tomcat.DataSource, so I believe each jsp page may use a different database
connection. So, mysql inside is slow. Anything I can do?
I checked server cpu and memory. Cpu is 20%, memory is lower than 50%.
Everything is running on one server machine, one tomcat, one mysql, runs on
Ubuntu: 4.15.0-54-generic, Tomcat/9.0.16, mysql: 8.0.21.
Any information would be appreciated. Thanks in advance.
This is certainly an application issue, so I have marked this thread as
"off-topic". That doesn't mean we can't help.
Please confirm the following:
1. An initial request arrives on the server which executes a SQL DML
query, which changes some data in your database. The transaction is
committed. The response is sent to the client.
2. A second request arrives *after the completion of the first request*
and queries the data which was changed in #1 above. The data retrieved
from the database appears to have values which are "old" -- that is, the
value that was expected before #1 above occurred.
Some questions:
* Are you sure that #2 happens fully after #1? How are you sure?
* Are you absolutely sure you are querying the *same* data from the
database?
* Are you absolutely sure that there is no "step 1.5" where the data are
changed *back* to their original values? How are you sure?
* What is the "transaction isolation level" of your database
connections? Do you execute your query in #2 within a transaction?
-chris
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org