Solved

DOA & BCB6

Posted on 2004-04-15
4
1,043 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…

696 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