Page 1 of 1

Query logging?

Posted: Wed 17 Sep 2008 08:06
by Pawel Tarnik
Hi,

I'm currently working on a project with OraDirect.NET and Entity Framework.
The problem that I have is that I can't see how exactly looks PL-SQL code that goes to the DB. It's very painful, especially when there is some exception during execution of this SQL on DB.

My question is:
Is there a way in OraDirect.NET to log queries that go to the DB, so that they can be viewed later?

Posted: Wed 17 Sep 2008 17:51
by huanghexd
Recently I was wondering the same question and it took me a while to figure it out. Man, we need better document :-( Here is one way to do it:

1) refer to the following 2 assembly:
CoreLab.Data
CoreLab.Oracle
(which can be found at C:\Program Files\Devart\OraDirect.NET2\ if you installed the drivers in the default location).

2) create a monitoring objecct before you create the object context object:

CoreLab.Oracle.OracleMonitor oracleMonitor1 = new CoreLab.Oracle.OracleMonitor();

oracleMonitor1.IsActive = true;

3) Run the DBMonitor before you run your program.

That's it. You will catch all sql texts sent to the Oracle database.