Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CDatabase::Close is not happening

CDatabase::Close is not happening

Scheduled Pinned Locked Moved C / C++ / MFC
databasepostgresqlhelp
2 Posts 2 Posters 0 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
    SelvaKr
    wrote on last edited by
    #1

    Hi, I am establishing a connection with the postgres database when my application comes up. And closing the connection during the exit of my application. But some times during the exit, application hangs in the "database.close()" statement. i.e. Execution is not moving to the next line. even for 2 days it stays there in the same close statement. Any help would be appreciated. Thanks in advance...

    Selva

    N 1 Reply Last reply
    0
    • S SelvaKr

      Hi, I am establishing a connection with the postgres database when my application comes up. And closing the connection during the exit of my application. But some times during the exit, application hangs in the "database.close()" statement. i.e. Execution is not moving to the next line. even for 2 days it stays there in the same close statement. Any help would be appreciated. Thanks in advance...

      Selva

      N Offline
      N Offline
      Niklas L
      wrote on last edited by
      #2

      First of all, let me salute your patience. 2 days? Not bad. You don't need an explicit close() since it's taken care of in the destructor if it's still open. (Of course, you need to delete the CDatabase object if it's allocated in the heap.) Try without, and see what happens. You should be able to call close() multiple times, so there is probably something fishy in you code (or ODBC driver).

      home

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups