Solved

DOA & BCB6

Posted on 2004-04-15
4
1,030 Views
Last Modified: 2013-11-17
Hello experts!

How can i`m emulate dinamicaly, for example, 100 user connections to Oracle DB using DOA?

Best regards.
Dmitry.
0
Comment
Question by:GDE
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 9

Expert Comment

by:Cayce
ID: 10843974
1) get the Delphi Direct ORACLE Access Components from: http://sourceforge.net/projects/delphioci/
2) create a new package in BCB6, put every .pas file found on the "src" folder of the delphioci project
3) add the DesignIntf.pas file to the package (it's fund under $(BCB)/Source/ToolsAPI)
4) build and install the package. This will give you the new following components:
  TAMemoryDataset, TAOraSQL, TAOraUpdateSQL, TMemoryDataset, TOraDB, TOraSQL
  they will all be under the "Data Access" toolbar
5) documentation for all these components is found on the "doc" folder of the delphioci package
6) Now you just need to create an application that makes about 20 threads, each with it's own connection, running a serie of transactions against the oracle database (and harvesting performance data on the way), then distribute your resulting application into several computers (5 or so), and run them all at once.

There you go, a DOA client load simulator.

Good Luck!
0
 
LVL 2

Author Comment

by:GDE
ID: 10856427
I`m have DOA v.3.4.6.1 installed on my computer.
Can i`m dynamically create oracle session (TOralceSession)?
have you any example?

tnx.
Dmitry
0
 
LVL 9

Accepted Solution

by:
Cayce earned 500 total points
ID: 11034604
Are you using the DOA components from allroundautomations ? (It looks like to me)

Please let me know so I relate to the proper documentation.

I like the Delphi DOA components from SourceForge (due their open source nature), and I've never used the allroundautomation ones (which look ok! and they are cheap too).

The current version of the DOA I could find is 4.05. As far as I could look into the documentation you can create multiple instances of a TOracleSession.
From DOA 4.05 documentation:
"You use the TOracleSession component to connect to an Oracle database and to control transactions. You can use many sessions simultaneously, accessing different databases."

There's plenty of examples and documentation on these components in this package: http://www.allroundautomations.nl/doac6.exe.

What I would suggest doing (if you're using these components) is:
1) Create a thread that starts up it's own TOracleSession that runs transactions against the database. Logon to the database. Create a TOracleQuery component and then assign the Session property, now execute Querys until the thread is asked to stop.

Something like this:

#include <Oracle.hpp>

class MyThread : public TThread {
private:
  TOracleSession* Session;
  TOracleQuery* Query;
public:
  __fastcall MyThread(TComponent* Owner) {
    Session = new TOracleSession(Owner);
    Query = new TOracleQuery(Owner);
  }
  void __fastcall ~MyThread() {
    delete Query;
    delete Session;
  }
  void __fastcall Startup() {
    Session->LogonUsername = "DBA";
    Session->LogonPassword = "DBA";
    Session->LogonDatabase = "PerformanceTest";
    Session->Pooling = spNone;
    try {
      Session->LogOn();
    } catch(EOracleError &e) {
      // do something
    }
    Query->Session = Session;
  }
  void __fastcall Cleanup() {
    Query->Close();
    Session->LogOff();
  }
  void __fastcall RunQuery() {
    static int QueryIndex = 0;
    static const int    NumQueries = 3;
    // these files contain the SQL statement
    static const String Queries[NumQueries] = { "query1.sql", "query2.sql", "query3.sql" };
    if(Session->Connected) {
      if(QueryIndex == NumQueries)
        QueryIndex = 0;
      Query->SQL->LoadFromFile(Queries[QueryIndex++]);
      // if the query has some variables, modify the Variable property
      Query->Execute();
      // do something with the query data (if query is a SELECT statement)
    }
  }
  void __fastcall Execute() {
    Startup();
    while(!Terminated)  {
      RunQuery();
    }
    Cleanup();
  }
};
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How can I debug SSIS using Visual Studio 2008 2 84
Use tracing facilities in your browser steps 2 126
debug as  junit test 4 87
oracle 11g 23 129
In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question