code: @Override
      public Client getClientInstance()
      {
          // if threadsafe recycle the same single instance; if not create a new
          // instance
  
          if (isThreadSafe())
          {
              logger.info("Returning threadsafe used client instance for persistence unit : " + persistenceUnit);
              if (client == null)
              {
                  client = instantiateClient(persistenceUnit);
              }
          }
          else
          {
              logger.debug("Returning fresh client instance for persistence unit : " + persistenceUnit);
              // no need to hold a client reference.
              return instantiateClient(persistenceUnit);
          }
  
          return client;
      }
docs: Gets the client instance.
  
  @return the client instance