This is a migrated thread and some comments may be shown as answers.

Problem with tracing

3 Answers 65 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Fabio Perrone
Top achievements
Rank 1
Fabio Perrone asked on 03 Feb 2013, 06:51 PM
Hello, I'm having some problems when I try to trace the SQL statements sent to my SQLite database. I use an OpenAccessContext derived class defined in a separate assembly which is instantiated in a class constructor and disposed in the method Dispose of my class. If I use a StringWriter (as stated in the documentation), nothing happens (the instance of StringWriter.ToString() is just empty). If I enable logging in the model, the problem is the same: nothing is logged in the Profiler and Tuning Advisor (even if I regularly connect to the database in the Advisor and I call the StartProfilerService in the bootstrapper of my app) . I also have to say that the connection string to the database is dynamically passed to the constructor of the OpenAccessContext derived class (I don't use a fixed connection string in the App.config). How can I solve this problem? What's wrong with this approach?
Thanks in advance

Fabio

3 Answers, 1 is accepted

Sort by
0
Boris Georgiev
Telerik team
answered on 06 Feb 2013, 07:59 PM
Hello Fabio,

I have prepared a sample application which demonstrates how to log and trace your queries in Telerik OpenAccess ORM in two different ways: with StringWriter and with System.Console. In the zip file you can also find SQLite database - SofiaCarRental21.db in the folder TestTracing\bin\debug and the sample should work out of the box.

Here is an article that explains How to: Trace SQL Statements Generated by OpenAccessContext.

I hope that helps. If any other questions arise, do not hesitate to contact us.
 

Regards,
Boris Georgiev
the Telerik team
Q3'12 SP1 of OpenAccess ORM packs Multi-Table Entities mapping support. Check it out.
0
Fabio Perrone
Top achievements
Rank 1
answered on 07 Feb 2013, 08:04 AM
Thanks, Boris, I'll check my application (your works like a charm). Just another question: how can I see the parameter values?

Thanks again,

Fabio
0
Boris Georgiev
Telerik team
answered on 11 Feb 2013, 11:37 AM
Hi Fabio,

If you want to see the parameters values in the log, you should go to Model Settings -> Backend Configuration -> Tracing and Logging and check the Log Level to All.

Here is an article that describes the Tracing and Logging window in the OpenAccess Visual Designer

I hope that helps.
 
Greetings,
Boris Georgiev
the Telerik team
Q3'12 SP1 of OpenAccess ORM packs Multi-Table Entities mapping support. Check it out.
Tags
Data Access Free Edition
Asked by
Fabio Perrone
Top achievements
Rank 1
Answers by
Boris Georgiev
Telerik team
Fabio Perrone
Top achievements
Rank 1
Share this question
or