一个线程挂在java.net.SocketInputStream.socketRead0(Native Method)上,有谁知道发生了什么?

时间:2012-03-22 06:52:49

标签: mysql sockets jdbc hang

 "[GMQMsgConsumeThread:113.105.152.146:22300, queue:Q_COOMIX_IMG_META]" prio=10 tid=0x08431000 nid=0x774c runnable [0x6e6b5000]
       java.lang.Thread.State: RUNNABLE
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:129)
        at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:113)
        at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:160)
        at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:188)
        - locked <0x83f593e0> (a com.mysql.jdbc.util.ReadAheadInputStream)
        at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1910)
        at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:501)
        at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:379)
        at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:1970)
        at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:1387)
        at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1195)
        - locked <0x83f596a0> (a java.lang.Object)
        at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:693)
        at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1266)
        - locked <0x83f596a0> (a java.lang.Object)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
    .........
    .........

       Locked ownable synchronizers:
        - None

关系环境如下:

mysql:5.1.56 mysql jdbc驱动程序:MySQL Connector / J 5.0.4 DBCP 1.4

关于可能是什么原因的任何想法?

感谢

1 个答案:

答案 0 :(得分:2)

这是由死锁引起的。尝试读取未提交的数据。我的情况是数据是在数据库模式上,因为我试图做的操作是一个ALTER TABLE。