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. Multi-thread connect to mysql problem
Forum Updated to NodeBB v4.3 + New Features

Multi-thread connect to mysql problem

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 680 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.
  • S Offline
    S Offline
    songzhao831
    wrote on last edited by
    #1

    Hi guys,

    I meet problems when do the multi-thread access mysql on QT5.2.1. i tried many times for mysql open and access like below,

    1. open connection in main(), and in other thread, only use query to access. the issue is lost mysql connection after a while.
    2. open connection in each thread. but need remove the connection when the thread end. but meet the scope issue."'qt_sql_default_connection' is still in use"

    The source code is blow. when many connection coming at the same time, program crash.
    Do you have any idea?

    The source code is too long, please open this link.http://www.qtcn.org/bbs/read-htm-tid-56216.html

    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