mysql JDBC tomcat

tony.chamberlain at lemko.com tony.chamberlain at lemko.com
Fri Feb 15 14:39:38 UTC 2008


Perhaps there is a mysql group I could ask? But I will ask here anyway.

Someone is using java and tomcat and mysql. Accessing mysql on 10.0.0.66
from 10.10.0.2. They are pingable from each other but go through gateway
10.10.0.30.

And mysql -h 10.0.0.66 
from 10.10.0.2 returns a prompt after a while.

However using jdbc times out even with a timeout of 70000. Here is the command:


jdbc:mysql://10.0.0.66/dma_oam?useUnicode=true&characterEncoding=Big5&socketTimeout=700000&connectTimeout=700000 id
(id omitted from this message for security reasons)

This is being executed from Java. 

And to repeat, when it was used before there were 1 hop from server machine to host machine (like here):
traceroute to 10.0.0.50 (10.0.0.50), 30 hops max, 38 byte packets
 1 10.0.0.50 (10.0.0.50) 1.158 ms 0.198 ms 0.186 ms
but in this case there are two
traceroute to 10.0.0.66 (10.0.0.66), 30 hops max, 38 byte packets
 1 10.10.0.30 (10.10.0.30) 20.068 ms 19.775 ms 19.806 ms
 2 10.0.0.66 (10.0.0.66) 24.404 ms 23.240 ms 23.249 ms


Could this be the reason for the timeout? Can jdbc not hop?


if you are interested, here is a stack backtrace

java.net.SocketTimeoutException: Read timed out
 at java.net.SocketInputStream.socketRead0(Native Method)
 at java.net.SocketInputStream.read(SocketInputStream.java:129)
 at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
 at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
 at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
 at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1316)
 at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1463)
 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1854)
 at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1109)
 at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1203)
 at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:1164)
 at com.mysql.jdbc.Connection.execSQL(Connection.java:2087)
 at com.mysql.jdbc.Connection.execSQL(Connection.java:2037)
 at com.mysql.jdbc.Statement.executeQuery(Statement.java:1156)
 at com.mysql.jdbc.Connection.initializePropsFromServer(Connection.java:2753)
 at com.mysql.jdbc.Connection.createNewIO(Connection.java:1671)
 at com.mysql.jdbc.Connection.<init>(Connection.java:432)



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20080215/32627364/attachment-0001.htm>


More information about the fedora-list mailing list