Problem with tracing

4 posts, 0 answers
  1. Fabio Perrone
    Fabio Perrone avatar
    3 posts
    Member since:
    Sep 2009

    Posted 03 Feb 2013 Link to this post

    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
  2. Boris Georgiev
    Admin
    Boris Georgiev avatar
    190 posts

    Posted 06 Feb 2013 Link to this post

    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.
  3. DevCraft banner
  4. Fabio Perrone
    Fabio Perrone avatar
    3 posts
    Member since:
    Sep 2009

    Posted 07 Feb 2013 Link to this post

    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
  5. Boris Georgiev
    Admin
    Boris Georgiev avatar
    190 posts

    Posted 11 Feb 2013 Link to this post

    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.
Back to Top