Uploaded image for project: 'CUBRID APIs'
  1. CUBRID APIs
  2. APIS-23

Support cubrid_pconnect like mysql_pconnect

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PHP-8.4.1
    • Component/s: PHP Driver
    • Labels:
      None

      Activity

      Hide
      kadishmal Esen Sagynov added a comment -

      Couple months ago we have discussed this feature. Check our conversation at SF.net forum. The idea is CUBRID Broker supports Persistent Connection, which we cannot change through API. So, to support cubrid_pconnect, CCI has to be changed, which I am not sure if possible. So, have a look and keep us posted. Thanks.

      Show
      kadishmal Esen Sagynov added a comment - Couple months ago we have discussed this feature. Check our conversation at SF.net forum . The idea is CUBRID Broker supports Persistent Connection, which we cannot change through API. So, to support cubrid_pconnect, CCI has to be changed, which I am not sure if possible. So, have a look and keep us posted. Thanks.
      Hide
      hellohuizhang 张慧 added a comment -

      Persistent connections are links that do not close when the execution of your script ends. When a persistent connection is requested, PHP checks if there's already an identical persistent connection (that remained open from earlier) - and if it exists, it uses it. If it does not exist, it creates the link. An 'identical' connection is a connection that was opened to the same host, with the same username and the same password (where applicable).

      We add two functions, cubrid_pconnect and cubrid_pconnect_with_url, to provide persistent database connections. The parameters of cubrid_pconnect are same with cubrid_connect, and so do cubrid_pconnect_with_url and cubrid_connect_with_url.

      Show
      hellohuizhang 张慧 added a comment - Persistent connections are links that do not close when the execution of your script ends. When a persistent connection is requested, PHP checks if there's already an identical persistent connection (that remained open from earlier) - and if it exists, it uses it. If it does not exist, it creates the link. An 'identical' connection is a connection that was opened to the same host, with the same username and the same password (where applicable). We add two functions, cubrid_pconnect and cubrid_pconnect_with_url, to provide persistent database connections. The parameters of cubrid_pconnect are same with cubrid_connect, and so do cubrid_pconnect_with_url and cubrid_connect_with_url.
      Hide
      xiaoshan78 李成龙[이성룡] added a comment -

      Persistent connection mechanism is not same as Connection pooling. We do not need implementation of connection pooling in CCI.

      At first, I thought pconnect need connection pooling mechanism.
      When I heard connection pooling will supported since CUBRID 8.4.1, I want to add pconnect features to PHP interface.

      But, 张慧 point out that Persistent connection is different from Connection pooling.

      Persistent connection vs. Connection pooling

      Persistent connection Connection pooling
      only one connection in Persistent connection mode Connection pooling enables more connections
      second call of cubrid_pconnect() will reuse connection that opened by first call of cubrid_pconnect(), even the connection not closed by cubrid_close() second call of cubrid_connect_pool() (assumed name) will get new connection from the pool, it different from connection got by first call of cubrid_connect_pool()

      So, cubrid_pconnect() can implemented in lower version such as 8.4.0
      If there is a demand in lower version of PHP interface, we can add pconnect features.

      Show
      xiaoshan78 李成龙[이성룡] added a comment - Persistent connection mechanism is not same as Connection pooling. We do not need implementation of connection pooling in CCI. At first, I thought pconnect need connection pooling mechanism. When I heard connection pooling will supported since CUBRID 8.4.1, I want to add pconnect features to PHP interface. But, 张慧 point out that Persistent connection is different from Connection pooling. Persistent connection vs. Connection pooling Persistent connection Connection pooling only one connection in Persistent connection mode Connection pooling enables more connections second call of cubrid_pconnect() will reuse connection that opened by first call of cubrid_pconnect(), even the connection not closed by cubrid_close() second call of cubrid_connect_pool() (assumed name) will get new connection from the pool, it different from connection got by first call of cubrid_connect_pool() So, cubrid_pconnect() can implemented in lower version such as 8.4.0 If there is a demand in lower version of PHP interface, we can add pconnect features.
      Hide
      hellohuizhang 张慧 added a comment -

      commit rev: 298

      Show
      hellohuizhang 张慧 added a comment - commit rev: 298
      Hide
      hellohuizhang 张慧 added a comment -

      We have fixed this issue on PHP-8.4.1

      Show
      hellohuizhang 张慧 added a comment - We have fixed this issue on PHP-8.4.1

        People

        • Assignee:
          hellohuizhang 张慧
          Reporter:
          xiaoshan78 李成龙[이성룡]
        • Votes:
          0 Vote for this issue
          Watchers:
          2 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: