Kristian Waagan <Kristian.Waagan@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
|