Fast Object Database for Java - with JPA/JDO support

Show Sql/Jpql


Is there a way to show the executed Sql/Jpql in the console?


You can set the log element in ObjectDB configuration to write logging also to the console:

    <log path="$objectdb/log/" max="8mb" stdout="true" stderr="false" />

When stdout is set to true, all the logging information is written to the console, in addition to being written to the log file. Currently you cannot send only selective information from the log to the console.

To write query execution to the log, add the following logger element to the configuration:

    <logger name="query.manager" level="debug" />
ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

I know that, but is there a possibility to see it in Sql/Jpql style not xml. I can only see select statements, but I also want to see insert, update and delete


It may be a good idea to log queries as strings in TRACE logging level.

ObjectDB (unlike ORM JPA implementation) does not use queries to implement Insert, Update and Delete operations (except delete/update queries). You may log these operations by setting a JPA lifecycle listener or callback.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Build 2.4.7_01 adds simple text logging of query execution.

It could be enabled by setting the following logger in the configuration file:

    <logger name="query.manager" level="trace" />

This will generate logging lines, such as:

Query "SELECT e FROM MyEntity e" => 100 results in 1 milliseconds.
ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Post Reply