Spanner/src/Database.php
private function selectSession($context = SessionPoolInterface::CONTEXT_READ, array $options = [])
    {
        if ($this->session) {
            return $this->session;
        }

        if ($this->sessionPool) {
            return $this->session = $this->sessionPool->acquire($context);
        }

        return $this->session = $this->operation->createSession($this->name, $options);
    }
private function selectSession($context = SessionPoolInterface::CONTEXT_READ, array $options = [])
    {
        if ($this->session) {
            return $this->session;
        }

        if ($this->sessionPool) {
            return $this->session = $this->sessionPool->acquire($context);
        }

        return $this->session = $this->operation->createSession($this->name, $options);
    }
private function selectSession ( $ context = SessionPoolInterface :: CONTEXT_READ , array $ options = [ ] ) { if ( $ this -> session ) { return $ this -> session ; } if ( $ this -> sessionPool ) { return $ this -> session = $ this -> sessionPool -> acquire ( $ context ) ; } return $ this -> session = $ this -> operation -> createSession ( $ this -> name , $ options ) ; }
If no session is already associated with the database use the session
pool implementation to retrieve a session one - otherwise create on
demand.

@param string $context [optional] The session context. **Defaults to**
`r` (READ).
@param array $options [optional] Configuration options.
@return Session
If no session is already associated with the database use the session pool implementation to retrieve a session one - otherwise create on demand .