We are facing an issue with an API that is consuming a bit of time. In the log, it's showing the delay with a query.
[INFO ] 2022-06-01 13:38:51.122 (DataBuilder.java:294)
[DEBUG] 2022-06-01 13:38:52.927 (SqlStatementLogger.java:128) 100365241355070 -http-nio-8989-exec-230 - UPDATE USER_USAGE ....
This is the Repository method that has been invoked
@Transactional
@Modifying
@Query(value = "UPDATE USER_USAGE SET DAILY_COUNT = DAILY_COUNT + ?, WEEKLY_COUNT= WEEKLY_COUNT + ?,MONTHLY_COUNT= MONTHLY_COUNT + ?, "
+ " DAILY_USAGE = DAILY_USAGE + ?, WEEKLY_USAGE = WEEKLY_USAGE + ?, MONTHLY_USAGE = MONTHLY_USAGE + ? WHERE USER_ID = ? AND SERVICE_ID = ?", nativeQuery = true)
int updateUsage(int dailyc, int weeklyc, int monthlyc, double dailya, double weeklya, double monthlya, String userId, Integer service);
The time difference was more than one second, so we were wondering whether that query is being written into the log after or before executing it?
The database being used is Oracle.