question: private < T > T runWriteFreshConnection ( ConnectionSupplier conns , TableReference tableRef , Function < DbWriteTable , T > runner ) { log . debug ( "Running in a new thread to turn autocommit on for write" ) ; AtomicReference < T > result = Atomics . newReference ( ) ; Thread writeThread = new Thread ( null ) ; writeThread . start ( ) ; try { writeThread . join ( ) ; } catch ( InterruptedException e ) { throw Throwables . rewrapAndThrowUncheckedException ( e ) ; } return result . get ( ) ; }
target:  Runs with a new connection, in a new thread so we don't reuse the connection we're getting from ReentrantManagedConnectionSupplier. Note that most of DbKvs reuses connections so unlike most other calls, this can block on getting a new connection if the pool is full. To avoid deadlocks or long pauses, use this only when necessary.