The SQL execution time implementation code is tracked in ADF

  • 2021-01-22 05:32:50
  • OfStack

ADF is a set of enterprise developed solutions provided by oracle.
Recently, I did a performance test and needed to get how many SQL queries were on the current page and how long it took. The first thing that comes to mind is the commonly used log4jdbc. ADF does not support encapsulated drivers. After the attempt to intercept Orace DB level, more complex but also set the database connection sesson properties, also need to modify the code.

The ViewObjectImp version of ADF provides methods for copying SQL calls, but requires modification of the existing code. Finally, the ADF source code is modified to obtain the SQL execution time without modifying the existing code.

DSQLTruckerToFile=D:\log.txt -DenableSQLTracker=true -DSQLTruckerToFile :\log.txt -DenableSQLTracker=true
Restart and you will see the SQL execution time

195: < SQL: > SELECT Geos.CREATED_BY, Geos.CREATED_TS, Geos.FAX_NUMBER, Geos.FROM_EMAIL_ADDRESS, Geos.ID, Geos.MODIFIED_BY, Geos.MODIFIED_TS, Geos.NAME, Geos.PHONE_NUMBER, Geos.REPLY_TO_EMAIL_ADDRESS, Geos.IS_DEFAULT FROM GEOS Geos ORDER BY Geos.IS_DEFAULT,Geos.NAME
195: < ElapsedTime(ms): > 729

Related articles: