You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by anuj bhargava <an...@gmail.com> on 2007/07/23 22:31:58 UTC

Reg: tracing of derby functioning

Hello
I am Anuj and I am working on my final year project for which  i need to
understand internals of derby specially locking. I have gone through
transaction and lock modules in derby. but i still didn't get it fully.
Is there any way or tool  to trace functioning of derby like when a
transaction comes, which function is used to form query tree and then
optimization , and then how it interacts with lock manager like what type of
lock it gets, which function is used to release locks and then commit
transaction, where updated values before and after  updatation are stored if
transaction is update one.

Thx in anticipation
Anuj

Re: Reg: tracing of derby functioning

Posted by anuj bhargava <an...@gmail.com>.
Thanks a lot...

On 7/25/07, Dag H. Wanvik <Da...@sun.com> wrote:
>
> Kristian Waagan <Kr...@Sun.COM> writes:
>
> > anuj bhargava wrote:
> >> Hello
> >> I am Anuj and I am working on my final year project for which  i
> >> need to understand internals of derby specially locking. I have gone
> >> through transaction and lock modules in derby. but i still didn't
> >> get it fully.
> >> Is there any way or tool  to trace functioning of derby like when a
> >> transaction comes, which function is used to form query tree and
>
> Some more tracing hints:
>
> There is a property that allow you to trace statements as they are
> executed, cf.derby.language.logStatementText
> http://db.apache.org/derby/docs/dev/tuning/rtunproper43517.html
>
> You can also trace the compilation and see the results of the optimized
> query plan derby.language.logQueryPlan
>
> http://db.apache.org/derby/docs/dev/tuning/rtunproper43414.html#rtunproper43414
>
> If you download a debug version of Derby, the property
> derby.debug.true=<flag> can be used to get more information from the
> compiler phases, e.g. this way
> -Dderby.debug.true=DumpOptimizedTree. Check the source to see what flags
> are available.
>
> Example from GenericStatement.java:
> :
> SanityManager.DEBUG_ON("DumpOptimizedTree");
> :
>
> >> then optimization , and then how it interacts with lock manager like
> >> what type of lock it gets, which function is used to release locks
> >> and then commit transaction, where updated values before and after
> >> updatation are stored if transaction is update one.
>
> You may find the diagnostic table expression SYSCS_DIAG.LOCK_TABLE
> useful to see what locks are set at a given time, see
> http://db.apache.org/derby/docs/dev/ref/rrefsyscsdiagtables.html
>
> Good luck!
>
> Dag
>

Re: Reg: tracing of derby functioning

Posted by "Dag H. Wanvik" <Da...@Sun.COM>.
Kristian Waagan <Kr...@Sun.COM> writes:

> anuj bhargava wrote:
>> Hello
>> I am Anuj and I am working on my final year project for which  i
>> need to understand internals of derby specially locking. I have gone
>> through transaction and lock modules in derby. but i still didn't
>> get it fully.
>> Is there any way or tool  to trace functioning of derby like when a
>> transaction comes, which function is used to form query tree and

Some more tracing hints:

There is a property that allow you to trace statements as they are
executed, cf.derby.language.logStatementText
http://db.apache.org/derby/docs/dev/tuning/rtunproper43517.html

You can also trace the compilation and see the results of the optimized
query plan derby.language.logQueryPlan
http://db.apache.org/derby/docs/dev/tuning/rtunproper43414.html#rtunproper43414

If you download a debug version of Derby, the property
derby.debug.true=<flag> can be used to get more information from the
compiler phases, e.g. this way
-Dderby.debug.true=DumpOptimizedTree. Check the source to see what flags
are available.

Example from GenericStatement.java:
:
SanityManager.DEBUG_ON("DumpOptimizedTree");
:

>> then optimization , and then how it interacts with lock manager like
>> what type of lock it gets, which function is used to release locks
>> and then commit transaction, where updated values before and after
>> updatation are stored if transaction is update one.

You may find the diagnostic table expression SYSCS_DIAG.LOCK_TABLE
useful to see what locks are set at a given time, see
http://db.apache.org/derby/docs/dev/ref/rrefsyscsdiagtables.html

Good luck!

Dag

Re: Reg: tracing of derby functioning

Posted by anuj bhargava <an...@gmail.com>.
I have been studying 10.2 version.
Thanks for guidance


On 7/24/07, Kristian Waagan <Kr...@sun.com> wrote:
>
> anuj bhargava wrote:
> > Hello
> > I am Anuj and I am working on my final year project for which  i need to
> > understand internals of derby specially locking. I have gone through
> > transaction and lock modules in derby. but i still didn't get it fully.
> > Is there any way or tool  to trace functioning of derby like when a
> > transaction comes, which function is used to form query tree and then
> > optimization , and then how it interacts with lock manager like what
> > type of lock it gets, which function is used to release locks and then
> > commit transaction, where updated values before and after  updatation
> > are stored if transaction is update one.
>
> Hello Anuj,
>
> I am not aware of any such specialized tools. My advice would be to
> (continue) read the code and see if there are any papers/writeups that
> can give you an overview. Then maybe use a debugger to step through a
> simple transaction. You can then also change things in the setup, like
> the isolation level.
>
> I do not know much about the parser or optimizer, but I do know the
> plans are created as generated Java byte code. There is an option to
> dump the generated class files so that you can look at them (after using
> a decompiler?).
>
>
> There might be useful information here;
> http://db.apache.org/derby/integrate/index.html (look in the left column
> under Papers). I recommend looking at Dans presentation from Colorado
> 2004 (Software Summit).
>
> Sorry I can't help you more, but maybe someone else will add some
> valuable input. I think many people on the list are in release or
> vacation mode, so a little patience and a reminder might pay off :)
>
>
> Just out of curiosity, which version of Derby have you been studying?
> There has been some changes in the areas you are looking into.
>
>
>
> regards,
> --
> Kristian
>
> >
> > Thx in anticipation
> > Anuj
> >
>
>

Re: Reg: tracing of derby functioning

Posted by Kristian Waagan <Kr...@Sun.COM>.
anuj bhargava wrote:
> Hello
> I am Anuj and I am working on my final year project for which  i need to 
> understand internals of derby specially locking. I have gone through 
> transaction and lock modules in derby. but i still didn't get it fully.
> Is there any way or tool  to trace functioning of derby like when a 
> transaction comes, which function is used to form query tree and then 
> optimization , and then how it interacts with lock manager like what 
> type of lock it gets, which function is used to release locks and then 
> commit transaction, where updated values before and after  updatation 
> are stored if transaction is update one.

Hello Anuj,

I am not aware of any such specialized tools. My advice would be to 
(continue) read the code and see if there are any papers/writeups that 
can give you an overview. Then maybe use a debugger to step through a 
simple transaction. You can then also change things in the setup, like 
the isolation level.

I do not know much about the parser or optimizer, but I do know the 
plans are created as generated Java byte code. There is an option to 
dump the generated class files so that you can look at them (after using 
a decompiler?).


There might be useful information here; 
http://db.apache.org/derby/integrate/index.html (look in the left column 
under Papers). I recommend looking at Dans presentation from Colorado 
2004 (Software Summit).

Sorry I can't help you more, but maybe someone else will add some 
valuable input. I think many people on the list are in release or 
vacation mode, so a little patience and a reminder might pay off :)


Just out of curiosity, which version of Derby have you been studying?
There has been some changes in the areas you are looking into.



regards,
-- 
Kristian

> 
> Thx in anticipation
> Anuj
>