B4J Question About DB Connection Pooling

Discussion in 'B4J Questions' started by vfafou, Apr 23, 2015.

  1. vfafou

    vfafou Active Member Licensed User

    I'm trying to understand how to correctly implement connection pooling inside Custom WebSocket Push Framework.
    During reading several posts, I opened:
    and now I'm totally confused!
    Which is the best way to connect to a database for many concurrent devices requests? Using the above tutorial, making one connection per device thread or maintain one public connection for all devices?
    And all this is needed to be as real-time as possible!
    By the way, any help about correctly building connection pooling is highly appreciated!
    Thank you in advance!
  2. Erel

    Erel Administrator Staff Member Licensed User

    Which type of database are you using?

    Assuming that you are using a database such as MySQL then the best way is to create a single ConnectionPool and use it from all the threads.
    vfafou likes this.
  3. vfafou

    vfafou Active Member Licensed User

    Hello Erel!
    I'm using two Databases: one MySQL 4.0 Instance and one MariaDB 10.0 Instance, installed on different server machines.
    The MariaDB Instance is the Web Server Database and MySQL 4.0 is my old VB6 application's RDBMS.
    Testing whole system, I decided to connect web socket server to the old database in order to have faster response time rather than my previous case that I was sending messages from the web server to socket server which was forwarding the messages to my old VB6 application for executing several Database Jobs.
    I've already built the connection pooling and I think I have much better response than my previous approach.
    Great B4X tools!!!
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice