Solved

DOA & BCB6

Posted on 2004-04-15
4
985 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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. …
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…
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…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

895 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now