Results 1 to 3 of 3

Thread: QtSql: Maximum number of PREPARE statements

  1. #1
    Join Date
    Feb 2006
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QtSql: Maximum number of PREPARE statements

    Hi
    I am heavily using QSqlQuery::prepare() in my application and since I have to process a lot of data, mysql throws an error: ERROR 1461 (42000): Can't create more than max_prepared_stmt_count statements (current value: 16382)
    Can I somehow free these prepared statements? It is nice to use them, because I don't need to care how to escape variables when switching from MySQL to SQLite for example.
    I know I could optimize my code to do less queries, but this would make it less readable? Do you have any ideas?
    Last edited by kayssun; 24th April 2010 at 22:28. Reason: disabled smileys

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QtSql: Maximum number of PREPARE statements

    The limit deals with concurrent queries. If you don't forget to release the queries (i.e. by iterating to the end of their results and destroying all references to the query object) the database should release the resource as well.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    kayssun (25th April 2010)

  4. #3
    Join Date
    Feb 2006
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QtSql: Maximum number of PREPARE statements

    Thank you, I found a memory leak. That's probably it.

Similar Threads

  1. QtSql: execBatch() with SELECT statements
    By herrmarder in forum Qt Programming
    Replies: 2
    Last Post: 28th January 2010, 13:43
  2. Maximum number of controls in QWidget
    By soumyadeep_pan in forum Qt Programming
    Replies: 4
    Last Post: 7th February 2009, 04:53
  3. Oracle 11g1 prepare for Qt4.4
    By landonmkelsey in forum Installation and Deployment
    Replies: 0
    Last Post: 3rd December 2008, 20:26
  4. Maximum number of characters in width
    By ralphmerridew in forum Qt Programming
    Replies: 3
    Last Post: 27th May 2008, 01:55
  5. reading fprintf statements from console in qt
    By KrishnaKishan in forum Qt Programming
    Replies: 2
    Last Post: 15th March 2007, 10:00

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.