Best Practices : Starting the TCP Server from code

7 views
Skip to first unread message

Dr1Ku

unread,
Oct 20, 2009, 3:14:08 AM10/20/09
to H2 Database
Hi,

I'm trying to start the H2 TCP Server from code, it works, yet I
cannot get the output to be re-routed to a simple text file.

Here is the source : http://pastie.org/private/8qko5zsek1ta8xkcyi3cg

I also get this trace after the shutdownServer() Method is called :

java.net.SocketException: Socket closed
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:
99)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:
65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at java.io.DataOutputStream.flush(DataOutputStream.java:106)
at org.h2.value.Transfer.flush(Transfer.java:88)
at org.h2.server.TcpServerThread.sendError(TcpServerThread.java:201)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:140)
at java.lang.Thread.run(Thread.java:619)

But I'm guessing it's ok, it's just a reaction to the server shutdown,
am I mistaken ?

Thank you in advance for any input !

Thomas Mueller

unread,
Oct 23, 2009, 3:14:52 AM10/23/09
to h2-da...@googlegroups.com
Hi,

> I'm trying to start the H2 TCP Server from code, it works, yet I
> cannot get the output to be re-routed to a simple text file.

It works for me. Do you get an exception? The server doesn't have much
output by the way.

> I also get this trace after the shutdownServer() Method is called :

That's probably because there is still an open connection when you
stop the server. That's when I get the exception (but otherwise not).

Regards,
Thomas

Reply all
Reply to author
Forward
0 new messages