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
-
Method Summary
Modifier and TypeMethodDescriptionstatic SqlQueryList
Get the current queue of items and stop collectingstatic int
logQueriesForCurrentThreadAndStopCapturing
(int... theIndexes) Log all captured SELECT queriesprotected AtomicInteger
protected AtomicInteger
protected AtomicInteger
static void
Starts 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:
provideQueryList
in classBaseCaptureQueriesListener
-
provideCommitCounter
- Specified by:
provideCommitCounter
in classBaseCaptureQueriesListener
-
provideGetConnectionCounter
- Specified by:
provideGetConnectionCounter
in classBaseCaptureQueriesListener
-
provideRollbackCounter
- Specified by:
provideRollbackCounter
in 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
-