
Package ca.uhn.fhir.jpa.util
Class CurrentThreadCaptureQueriesListener
java.lang.Object
ca.uhn.fhir.jpa.util.BaseCaptureQueriesListener
ca.uhn.fhir.jpa.util.CurrentThreadCaptureQueriesListener
- All Implemented Interfaces:
net.ttddyy.dsproxy.support.ProxyDataSourceBuilder.SingleMethodExecution,net.ttddyy.dsproxy.support.ProxyDataSourceBuilder.SingleQueryExecution
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SqlQueryListGet the current queue of items and stop collectingstatic intlogQueriesForCurrentThreadAndStopCapturing(int... theIndexes) Log all captured SELECT queriesprotected AtomicIntegerprotected AtomicIntegerprotected AtomicIntegerstatic voidStarts capturing queries for the current thread.Methods inherited from class ca.uhn.fhir.jpa.util.BaseCaptureQueriesListener
countCommits, countGetConnections, countRollbacks, execute, execute, isCaptureQueryStackTrace, setCaptureQueryStackTrace
-
Constructor Details
-
CurrentThreadCaptureQueriesListener
public CurrentThreadCaptureQueriesListener()
-
-
Method Details
-
provideQueryList
- Specified by:
provideQueryListin classBaseCaptureQueriesListener
-
provideCommitCounter
- Specified by:
provideCommitCounterin classBaseCaptureQueriesListener
-
provideGetConnectionCounter
- Specified by:
provideGetConnectionCounterin classBaseCaptureQueriesListener
-
provideRollbackCounter
- Specified by:
provideRollbackCounterin classBaseCaptureQueriesListener
-
getCurrentQueueAndStopCapturing
Get the current queue of items and stop collecting -
startCapturing
Starts capturing queries for the current thread.Note that you should strongly consider calling this in a try-finally block to ensure that you also call
getCurrentQueueAndStopCapturing()afterward. Otherwise this method is a potential memory leak! -
logQueriesForCurrentThreadAndStopCapturing
Log all captured SELECT queries- Returns:
- Returns the number of queries captured
-