Skip to content

Commit f764198

Browse files
committed
Add comment
Add comment from #47759 (comment)
1 parent 180d3af commit f764198

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cpp/src/arrow/flight/sql/odbc/odbc_api.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ SQLRETURN SQLAllocHandle(SQLSMALLINT type, SQLHANDLE parent, SQLHANDLE* result)
7575
std::shared_ptr<ODBCConnection> conn = environment->CreateConnection();
7676

7777
if (conn) {
78+
// Inside `CreateConnection`, the shared_ptr `conn` is kept
79+
// in a `std::vector` of connections inside the environment handle.
80+
// As long as the parent environment handle is alive, the connection shared_ptr
81+
// will be kept alive unless the user frees the connection.
7882
*result = reinterpret_cast<SQLHDBC>(conn.get());
7983

8084
return SQL_SUCCESS;

0 commit comments

Comments
 (0)