Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QT + ODBC Connection Pooling
Forum Updated to NodeBB v4.3 + New Features

QT + ODBC Connection Pooling

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kuris996
    wrote on last edited by
    #1

    Hello!

    I want to use a connection pooling in my application. I wrote a simple test:

    @
    QString connectionString = QString::fromLatin1(
    "DRIVER={SQL Server Native Client 10.0};SERVER=%1;DATABASE=%2;")
    .arg("DESIGNER\SQLEXPRESS")
    .arg("testdb");

    QString opts = QLatin1String("SQL_ATTR_CONNECTION_POOLING=SQL_CP_ONE_PER_HENV");
    
    QSqlDatabase db = QSqlDatabase::addDatabase(QLatin1String("QODBC3"));
    db.setDatabaseName(connectionString);
    db.setConnectOptions(opts);
    db.setUserName("root");
    db.setPassword("1");
    
    while (1) {
        db.open();
        QThread::msleep(100);
    }
    

    @

    In Performance Monitor i do not observe any ODBC Connection Pooling activity. What's wrong?

    1 Reply Last reply
    0
    • hskoglundH Offline
      hskoglundH Offline
      hskoglund
      wrote on last edited by
      #2

      Hi, a guess: to be sure you're on ODBC3 perhaps you'll need to set that option as well, like:
      @
      QString opts = QLatin1String("SQL_ATTR_CONNECTION_POOLING=SQL_CP_ONE_PER_HENV;SQL_ATTR_ODBC_VERSION=SQL_OV_ODBC3;");
      @

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved