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. Oracle, CDatabase and multithread

Oracle, CDatabase and multithread

Scheduled Pinned Locked Moved C / C++ / MFC
c++questioncsharpdatabaseoracle
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.
  • N Offline
    N Offline
    Nandiator
    wrote on last edited by
    #1

    Hi you all. I have a thread intensive windows service written in Visual C++ for a communicacions app. There is a mother thread which launches child threads each of which opens a new connection to Oracle by means of the ODBC Driver. The child threads are created and die, buy sometimes a big amount of them can be created at the same time (about 200 threads when a massive alert is sent to the remote client apps) which mean that about 200 connections are opened against the driver and last for some time. My problem is that when this happens some threads are frozen in the Open function of the CDatabase connection. I tried to write a bit of code to test it (one loop which launched threads which just opened connections to the database and waited in an infinite loop to keep everything opened) and the problem persisted. But as this time it was a desktop app (not a winservice) an Oracle ODBC Driver Connect dialog showed asking for Service Name, User Name and Password. I tested the same code against a SQLServer driver and the app had no problem in launching all the threads. So now comes the question ¿is there a limit in oracle's driver for the number of connections per process? I am using Oracle's Driver version 10.01.00.31, the database is an Oracle 10gR1, and the service is written in Visual C++ (Visual Studio 2003). The database is not owned by us, so we cannot modify any parameters.

    C 1 Reply Last reply
    0
    • N Nandiator

      Hi you all. I have a thread intensive windows service written in Visual C++ for a communicacions app. There is a mother thread which launches child threads each of which opens a new connection to Oracle by means of the ODBC Driver. The child threads are created and die, buy sometimes a big amount of them can be created at the same time (about 200 threads when a massive alert is sent to the remote client apps) which mean that about 200 connections are opened against the driver and last for some time. My problem is that when this happens some threads are frozen in the Open function of the CDatabase connection. I tried to write a bit of code to test it (one loop which launched threads which just opened connections to the database and waited in an infinite loop to keep everything opened) and the problem persisted. But as this time it was a desktop app (not a winservice) an Oracle ODBC Driver Connect dialog showed asking for Service Name, User Name and Password. I tested the same code against a SQLServer driver and the app had no problem in launching all the threads. So now comes the question ¿is there a limit in oracle's driver for the number of connections per process? I am using Oracle's Driver version 10.01.00.31, the database is an Oracle 10gR1, and the service is written in Visual C++ (Visual Studio 2003). The database is not owned by us, so we cannot modify any parameters.

      C Offline
      C Offline
      Chris Meech
      wrote on last edited by
      #2

      The short answer is probably yes. I'd suggest you look over this[^] article for a start. The artice suggests that the size of the connection pool should be configurable at runtime. Chris Meech I am Canadian. [heard in a local bar] When I want privacy, I'll close the bathroom door. [Stan Shannon] BAD DAY FOR: Friendly competition, as Ford Motor Co. declared the employee parking lot at its truck plant in Dearborn, Mich., off limits to vehicles built by rival companies. Workers have to drive a Ford to work, or park across the street. [CNNMoney.com] Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]

      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