CConnection* CConnection::Clone() { CHECK_NCBI_DBAPI(m_ds == NULL, "m_ds is not initialized"); CConnection *conn = new CConnection(CloneCDB_Conn(), m_ds); if( m_msgToEx ) conn->MsgToEx(true); ++m_connCounter; return conn; }
IConnection* CConnection::CloneConnection(EOwnership ownership) { CHECK_NCBI_DBAPI(m_ds == NULL, "m_ds is not initialized"); CDB_Connection *cdbConn = CloneCDB_Conn(); CConnection *conn = new CConnection(m_ds, ownership); conn->m_modeMask = this->GetModeMask(); conn->m_forceSingle = this->m_forceSingle; conn->m_database = this->GetDatabase(); conn->m_connection = cdbConn; if( m_msgToEx ) conn->MsgToEx(true); conn->AddListener(m_ds); m_ds->AddListener(conn); return conn; }