We need to record the related connection in T_CUBRID_REQUEST and request list in T_CUBRID_CONNECT because of resource synchronization. Resource synchronization will happen in the following scenarios:
- When we close connection in PHP driver, we will close all the request handles that are created on this connection.
- When we close a request handle,
- if the connection is not disconnected, we need to tell the connection to delete the related node that store information for the request handle, then free other resource that are applied for itself.
- if the connection is closed, we just need to free the resource that are applied for itself.
Now, a linear list was used to realize the principles, but this linear list will never be decreased for a connection. So we will use a linked list instead of linear list.