Cannot trace insert statements ...

6 views
Skip to first unread message

ivrusuboca

unread,
Jul 7, 2008, 10:38:12 AM7/7/08
to H2 Database

Hi,

I am using this url : jdbc:h2:/tmp/
myh2;TRACE_LEVEL_FILE=3;LOCK_MODE=3;MVCC=TRUE ,

and I am trying to find the 'insert into mytable' statements inside
myh2.trace.db file . Unfortunately, I cannot find any although I do
find all 'select from mytable' statements ...

Is this possible ?

Thank you,
Ionut

Anu Padki

unread,
Jul 7, 2008, 2:26:44 PM7/7/08
to h2-da...@googlegroups.com
Please try trace_level_file=4, you will see the insert in the trace file.
- Anu

Thomas Mueller

unread,
Jul 7, 2008, 9:28:04 PM7/7/08
to h2-da...@googlegroups.com
Hi,

> Please try trace_level_file=4, you will see the insert in the trace file.

No, level 4 is to use SLF4J. See also
http://www.h2database.com/html/grammar.html#settracelevel

Trace level 3 should work. It does work for me. Could you check again?
Maybe your search was case sensitive, or you have searched in the
wrong file? If it still doesn't work for you, please provide a simple
standalone test case (a class with a main method) and the output
(trace.db) file you get.

Regards,
Thomas

Anu Padki

unread,
Jul 8, 2008, 12:51:02 PM7/8/08
to h2-da...@googlegroups.com
I can see it even with trace_level_file=3, I see something like
/**/stat123.execute("insert into t_quality_desc (quality_id, quality_desc) values (1000, 'TEST INSERT')");
07-08 12:48:00 jdbc[2]:
/*SQL*/insert into t_quality_desc (quality_id, quality_desc) values (1000, 'TEST INSERT')

My envt is 1.0.67 and the connection was embedded.
- Anu

ivrusuboca

unread,
Jul 8, 2008, 8:49:53 PM7/8/08
to H2 Database

Thank you, guys,

I am using 1.0.74 now.

My h2 database is embedded in a GUI-based application which deals with
100ks of messages per day.
Between h2 and my GUI there is Hibernate .
Yet, in the end, I should have still seen 'insert into <table>'
statements, inside my <database>.trace.db file.
All I saw was 100ks of 'select ' statements.

Since you, however, see it working in your environments then maybe it
is my environment that somehow broken.

I will upgrade to the (proven by Anu ) 1.0.76 and give it another try.

Thank you very much,
Ionut


On Jul 9, 1:51 am, "Anu Padki" <padk...@gmail.com> wrote:
> I can see it even with trace_level_file=3, I see something like
> /**/stat123.execute("insert into t_quality_desc (quality_id, quality_desc)
> values (1000, 'TEST INSERT')");
> 07-08 12:48:00 jdbc[2]:
> /*SQL*/insert into t_quality_desc (quality_id, quality_desc) values (1000,
> 'TEST INSERT')
>
> My envt is 1.0.67 and the connection was embedded.
> - Anu
>
> On Mon, Jul 7, 2008 at 9:28 PM, Thomas Mueller <thomas.tom.muel...@gmail.com>
> wrote:
>
>
>
>
>
> > Hi,
>
> > > Please try trace_level_file=4, you will see the insert in the trace file.
>
> > No, level 4 is to use SLF4J. See also
> >http://www.h2database.com/html/grammar.html#settracelevel
>
> > Trace level 3 should work. It does work for me. Could you check again?
> > Maybe your search was case sensitive, or you have searched in the
> > wrong file? If it still doesn't work for you, please provide a simple
> > standalone test case (a class with a main method) and the output
> > (trace.db) file you get.
>
> > Regards,
> > Thomas- Hide quoted text -
>
> - Show quoted text -

ivrusuboca

unread,
Jul 8, 2008, 10:46:44 PM7/8/08
to H2 Database

I think I found the reason :

I am using h2 in the following way :

step 1 :
I create a brand new embedded h2 , with the following url :

jdbc:h2:/tmp/h2/
myapp;TRACE_LEVEL_FILE=3;CACHE_SIZE=524288;LOCK_MODE=3;MVCC=TRUE

step 2 :
I specify Hibernate the connect to h2, this way :

jdbc:h2:/tmp/h2/myapp;CACHE_SIZE=524288;LOCK_MODE=3;MVCC=TRUE

All my h2 interactions go through Hibernate layer. But I do not think
this is the problem.

I think that the second ( Hibernate ) url is resetting
TRACE_LEVEL_FILE, which is previously set to 3 by the first url.

If this is the case, my question to you , guys, is : is this the
desired behaviour ? And, if so, does this mean that, in order to
preserve my first url settings, I should use the same flags in my
second url ?

Thank you,
Ionut
> > - Show quoted text -- Hide quoted text -

Thomas Mueller

unread,
Jul 8, 2008, 11:06:01 PM7/8/08
to h2-da...@googlegroups.com
Hi,

Yes, you need to set the TRACE_LEVEL_FILE=3 in your second URL as well. See also
http://www.h2database.com/html/grammar.html#settracelevel
"This setting is not persistent."

Regards,
Thomas

P.S. I suggest you don't change the subject of your mail because it is
very hard to follow the thread like that.

Reply all
Reply to author
Forward
0 new messages