[求助]Mysql 错误。 寻求帮助_MySQL, Oracle及数据库讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  MySQL, Oracle及数据库讨论区 »
总帖数
1
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 3390 | 回复: 0   主题: [求助]Mysql 错误。 寻求帮助        下一篇 
leixianp
注册用户
等级:新兵
经验:57
发帖:64
精华:0
注册:2011-7-26
状态:离线
发送短消息息给leixianp 加好友    发送短消息息给leixianp 发消息
发表于: IP:您无权察看 2014-12-5 15:44:33 | [全部帖] [楼主帖] 楼主

       我先描述下环境。我们这里有个rss download server。 使用activemq + timertask schual。 每格一个小时运行一次。数据库里大概有6000多个Feed。 rss download server并发30个线程去download feed 然后更新数据库。 可是这几天发现。download server工作不正常。时常是个好几个小时工作一次。或者更本就不工作。常看日志发现。 mysql执行一条update语句都需要十多分钟? 日志请看下面:

sql 代码

2007-04-28 10:54:29,415 INFO  [STDOUT] Hibernate: update CHANNELS set IS_DOWNLOADING=?, LAST_UPDATED=now() where CHANNEL_ID=?
2007-04-28 11:09:26,057 WARN  [org.hibernate.util.JDBCExceptionReporter] SQL Error: 0, SQLState: 08S01
2007-04-28 11:09:26,550 ERROR [org.hibernate.util.JDBCExceptionReporter] Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.io.EOFException
STACKTRACE:
java.io.EOFException
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1903)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2402)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2860)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:771)
at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1289)
at com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:2270)
at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:423)
at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:1960)
at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:1385)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1728)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2978)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2902)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:933)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1027)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:211)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:139)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1669)
at org.hibernate.loader.Loader.doQuery(Loader.java:662)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.loadCollection(Loader.java:1919)
at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36)
at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:520)
at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60)
at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1676)
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:344)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
at org.hibernate.collection.PersistentBag.iterator(PersistentBag.java:246)
at com.monitor110.rss.download.service.DownloadServiceDaoHibernateImpl.isNewItem(DownloadServiceDaoHibernateImpl.java:163)
at com.monitor110.rss.download.service.DownloadServiceDaoHibernateImpl.checkAndSaveNewItems(DownloadServiceDaoHibernateImpl.java:221)
at com.monitor110.rss.download.service.DownloadServiceDaoHibernateImpl.access$100(DownloadServiceDaoHibernateImpl.java:44)
at com.monitor110.rss.download.service.DownloadServiceDaoHibernateImpl$2.doInHibernate(DownloadServiceDaoHibernateImpl.java:137)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:367)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:333)
at com.monitor110.rss.download.service.DownloadServiceDaoHibernateImpl.save(DownloadServiceDaoHibernateImpl.java:118)
at com.monitor110.rss.download.service.DownloadServiceImpl.persist(DownloadServiceImpl.java:41)
at sun.reflect.GeneratedMethodAccessor168.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:299)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:139)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy84.persist(Unknown Source)
at com.monitor110.rss.download.service.DownloadResultConsumer.onMessage(DownloadResultConsumer.java:28)
at org.jencks.LocalTransactionEndpoint.onMessage(LocalTransactionEndpoint.java:68)
at org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.onMessage(MessageEndpointProxy.java:121)
at org.apache.activemq.ra.MessageEndpointProxy.onMessage(MessageEndpointProxy.java:61)
at org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:695)
at org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:165)
at org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java:291)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Thread.java:595)
** END NESTED EXCEPTION **
Last packet sent to the server was 914670 ms ago.
2007-04-28 11:09:27,882 ERROR [com.monitor110.rss.download.service.DownloadResultConsumer] Can't save download result
org.springframework.dao.DataAccessResourceFailureException: could not initialize a collection: [com.monitor110.rss.domain.Channel.items#12686]; nested exception is org.hibernate.exception.JDBCConnectionException: could not initialize a collection: [com.monitor110.rss.domain.Channel.items#12686]
Caused by:
org.hibernate.exception.JDBCConnectionException: could not initialize a collection: [com.monitor110.rss.domain.Channel.items#12686]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:74)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.loadCollection(Loader.java:1926)
at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36)
at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:520)
at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60)
at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1676)
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:344)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
at org.hibernate.collection.PersistentBag.iterator(PersistentBag.java:246)
at com.monitor110.rss.download.service.DownloadServiceDaoHibernateImpl.isNewItem(DownloadServiceDaoHibernateImpl.java:163)
at com.monitor110.rss.download.service.DownloadServiceDaoHibernateImpl.checkAndSaveNewItems(DownloadServiceDaoHibernateImpl.java:221)
at com.monitor110.rss.download.service.DownloadServiceDaoHibernateImpl.access$100(DownloadServiceDaoHibernateImpl.java:44)
at com.monitor110.rss.download.service.DownloadServiceDaoHibernateImpl$2.doInHibernate(DownloadServiceDaoHibernateImpl.java:137)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:367)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:333)
at com.monitor110.rss.download.service.DownloadServiceDaoHibernateImpl.save(DownloadServiceDaoHibernateImpl.java:118)
at com.monitor110.rss.download.service.DownloadServiceImpl.persist(DownloadServiceImpl.java:41)
at sun.reflect.GeneratedMethodAccessor168.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:299)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:139)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy84.persist(Unknown Source)
at com.monitor110.rss.download.service.DownloadResultConsumer.onMessage(DownloadResultConsumer.java:28)
at org.jencks.LocalTransactionEndpoint.onMessage(LocalTransactionEndpoint.java:68)
at org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.onMessage(MessageEndpointProxy.java:121)
at org.apache.activemq.ra.MessageEndpointProxy.onMessage(MessageEndpointProxy.java:61)
at org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:695)
at org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:165)
at org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java:291)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Thread.java:595)
Caused by: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.io.EOFException
STACKTRACE:
java.io.EOFException
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1903)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2402)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2860)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:771)
at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1289)
at com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:2270)
at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:423)
at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:1960)
at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:1385)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1728)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2978)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2902)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:933)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1027)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:211)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:139)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1669)
at org.hibernate.loader.Loader.doQuery(Loader.java:662)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.loadCollection(Loader.java:1919)
at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36)
at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:520)
at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60)
at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1676)
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:344)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
at org.hibernate.collection.PersistentBag.iterator(PersistentBag.java:246)
at com.monitor110.rss.download.service.DownloadServiceDaoHibernateImpl.isNewItem(DownloadServiceDaoHibernateImpl.java:163)
at com.monitor110.rss.download.service.DownloadServiceDaoHibernateImpl.checkAndSaveNewItems(DownloadServiceDaoHibernateImpl.java:221)
at com.monitor110.rss.download.service.DownloadServiceDaoHibernateImpl.access$100(DownloadServiceDaoHibernateImpl.java:44)
at com.monitor110.rss.download.service.DownloadServiceDaoHibernateImpl$2.doInHibernate(DownloadServiceDaoHibernateImpl.java:137)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:367)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:333)
at com.monitor110.rss.download.service.DownloadServiceDaoHibernateImpl.save(DownloadServiceDaoHibernateImpl.java:118)
at com.monitor110.rss.download.service.DownloadServiceImpl.persist(DownloadServiceImpl.java:41)
at sun.reflect.GeneratedMethodAccessor168.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:299)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:139)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy84.persist(Unknown Source)
at com.monitor110.rss.download.service.DownloadResultConsumer.onMessage(DownloadResultConsumer.java:28)
at org.jencks.LocalTransactionEndpoint.onMessage(LocalTransactionEndpoint.java:68)
at org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.onMessage(MessageEndpointProxy.java:121)
at org.apache.activemq.ra.MessageEndpointProxy.onMessage(MessageEndpointProxy.java:61)
at org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:695)
at org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:165)
at org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java:291)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Thread.java:595)
** END NESTED EXCEPTION **
Last packet sent to the server was 914670 ms ago.
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2561)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2860)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:771)
at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1289)
at com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:2270)
at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:423)
at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:1960)
at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:1385)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1728)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2978)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2902)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:933)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1027)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:211)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:139)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1669)
at org.hibernate.loader.Loader.doQuery(Loader.java:662)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.loadCollection(Loader.java:1919)
... 34 more
2007-04-28 11:09:28,956 INFO  [STDOUT] Hibernate: insert into DOWNLOAD_EVENTS (EVENT_TIME, EVENT_TYPE, CHANNEL_URL, ERROR_MESSAGE, FEED_TITLE, EVENT_CATEGORY, CHANNEL_ID) values (?, ?, ?, ?, ?, ?, ?)
2007-04-28 11:09:46,123 WARN  [org.apache.commons.httpclient.HttpMethodBase] Cookie rejected: "$Version=0; cookieb2evosession=325238_kTKG95W2UgwnpNYoFDmTgALummwkBqbY; $Path=/; $Domain=.www.seeisee.com". Illegal domain attribute ".www.seeisee.com". Domain of origin: "www.seeisee.com"
2007-04-28 11:09:49,692 ERROR [org.hibernate.transaction.JDBCTransaction] JDBC commit failed
java.sql.SQLException: Can't call commit when autocommit=true
at com.mysql.jdbc.Connection.commit(Connection.java:2145)
at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:436)
at org.jboss.resource.adapter.jdbc.WrappedConnection.commit(WrappedConnection.java:331)
at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:139)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:115)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:570)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:651)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:621)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:311)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:117)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy84.persist(Unknown Source)
at com.monitor110.rss.download.service.DownloadResultConsumer.onMessage(DownloadResultConsumer.java:39)
at org.jencks.LocalTransactionEndpoint.onMessage(LocalTransactionEndpoint.java:68)
at org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.onMessage(MessageEndpointProxy.java:121)
at org.apache.activemq.ra.MessageEndpointProxy.onMessage(MessageEndpointProxy.java:61)
at org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:695)
at org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:165)
at org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java:291)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Thread.java:595)
2007-04-28 11:09:50,219 INFO  [STDOUT] Hibernate: update CHANNELS set IS_DOWNLOADING=?, LAST_UPDATED=now() where CHANNEL_ID=?
2007-04-28 10:54:29,415 INFO  [STDOUT] Hibernate: update CHANNELS set IS_DOWNLOADING=?, LAST_UPDATED=now() where CHANNEL_ID=?
2007-04-28 11:09:26,057 WARN  [org.hibernate.util.JDBCExceptionReporter] SQL Error: 0, SQLState: 08S01


从开始这段看出这条update语句竟然执行了15多分钟。 从后面的msyql的异常也可以知道

Last packet sent to the server was 914670 ms ago.


我想问问, 发生这种情况是不是msyql承受不了这样的压力呢?




赞(0)    操作        顶端 
总帖数
1
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论