How to debug the source code?

159 views
Skip to first unread message

齐哲之

unread,
Mar 10, 2012, 1:45:07 PM3/10/12
to h2-database
Hi all,

I've already read the h2doc and the javadoc.
I've import the source code into the Eclipse.

How can I debug the source code in order to figure out how the database works,
with inputting something like "create table","insert into" or something else?

By the way,I don't know how to run the source code in Eclipse actually.

To sum up,
1、how to input?
2、how to debug?


The Web Console server could not be started. Possible cause: another server is already running at http://169.254.19.57:8082
Exception in thread "main" org.h2.jdbc.JdbcSQLException: Exception opening port "8082" (port may be in use), cause: "java.net.BindException: Address already in use: JVM_Bind" [90061-163]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
    at org.h2.message.DbException.get(DbException.java:158)
    at org.h2.util.NetUtils.createServerSocketTry(NetUtils.java:190)
    at org.h2.util.NetUtils.createServerSocket(NetUtils.java:156)
    at org.h2.server.web.WebServer.start(WebServer.java:331)
    at org.h2.tools.Server.start(Server.java:455)
    at org.h2.tools.Server.runTool(Server.java:308)
    at org.h2.tools.Server.main(Server.java:116)
Caused by: java.net.BindException: Address already in use: JVM_Bind
    at java.net.PlainSocketImpl.socketBind(Native Method)
    at java.net.PlainSocketImpl.bind(Unknown Source)
    at java.net.ServerSocket.bind(Unknown Source)
    at java.net.ServerSocket.<init>(Unknown Source)
    at java.net.ServerSocket.<init>(Unknown Source)
    at org.h2.util.NetUtils.createServerSocketTry(NetUtils.java:186)
    ... 5 more

Thank you all,
Best Regards,
Jasonqi

Thomas Mueller

unread,
Mar 12, 2012, 4:06:04 AM3/12/12
to h2-da...@googlegroups.com
Hi,

I suggest to buy a book about Eclipse.

Regards,
Thomas
--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To post to this group, send email to h2-da...@googlegroups.com.
To unsubscribe from this group, send email to h2-database...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.

Thomas Mueller

unread,
Mar 12, 2012, 4:09:37 AM3/12/12
to h2-da...@googlegroups.com
Hi,

> The Web Console server could not be started.
> Possible cause: another server is already running at http://169.254.19.57:8082

The reason for this error message is most likely, that another server
is already running at http://169.254.19.57:8082.

Regards,
Thomas

齐哲之

unread,
Mar 12, 2012, 5:39:39 AM3/12/12
to h2-da...@googlegroups.com
Thank you , I‘m now starting to debug successfully.
At present , I've seen that if I open many session on my browser,there will be one 8082 about Console Server and many 9092 about TCP connection.

And some classes I've observed:
H2.tools.Server.java
H2.engine.session.java
H2.engine.Database.java
H2.schema.Schema.java
H2.engine.Engine.java
H2.server.TcpServerThread.java
H2.Driver.java
H2.jdbc.JdbcConnection.java
H2.engine.ConnectInfo.java

And now, I am going to figure out which parts of the source code is about the trasaction in order to move on the study on the concurrency control about the h2database.
Is it the H2.engine.session.java?Or maybe there are something else.

As seen from the h2.pdf,the default tansaction isolation level is "autocommit", so it was hard for me to see how the lock or something else observed when I inserted many complex data in two session at the same time.

Thank you for your help.
Best Regards,
Jasonqi

2012/3/12 Thomas Mueller <thomas.to...@gmail.com>

Thomas Mueller

unread,
Mar 15, 2012, 4:56:10 PM3/15/12
to h2-da...@googlegroups.com
Hi,

> I am going to figure out which parts of the source code is about
> the trasaction in order to move on the study on the concurrency control
> about the h2database.
> Is it the H2.engine.session.java?Or maybe there are something else.

You probably mean org.h2.engine.Session.java. Yes, this is a good
place to start.

Regards,
Thomas

Reply all
Reply to author
Forward
0 new messages