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();
}

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 ( ) ; }
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 .
