我们在BlueMix中部署的应用程序中存在问题。它只会在没有使用它们的情况下发生几天。第一个请求抛出粘贴的异常。看起来BlueMix在检测到没有活动时“冻结”MariaDB,因此第一个请求丢失。这是一个问题,因为第一次用户访问应用程序或执行呼叫(它是一个语音应用程序)页面或呼叫丢失并出现错误。
有关如何避免这种情况的任何想法? (希望避免包含一个线程每隔5分钟进行一次查询作为解决方法)
此外,BlueMix中任何推荐的免费替代MariaDB产品(我们非常习惯使用SQL作为JPA + Hibernate的持久提供程序),所以现在想坚持下去。
由于
[10/16/15 8:00:12:085 UTC] 000234d6 com.ibm.ejs.j2c.ConnectionEventListener A J2CA0056I: The Connection Manager received a fatal connection error from the Resource Adapter for resource jdbc/ElizaCCDS. The exception is: java.sql.SQLNonTransientConnectionException: Could not read resultset: unexpected end of stream, read 0 bytes from 4:org.mariadb.jdbc.internal.common.QueryException: Could not read resultset: unexpected end of stream, read 0 bytes from 4:java.io.EOFException: unexpected end of stream, read 0 bytes from 4
[10/16/15 8:00:12:093 UTC] 000234d6 com.ibm.ws.rsadapter.spi.WSRdbXaResourceImpl E DSRA0304E: XAException occurred. XAException contents and details are: The cause is : null.
[10/16/15 8:00:12:093 UTC] 000234d6 com.ibm.ws.rsadapter.spi.WSRdbXaResourceImpl E DSRA0302E: XAException occurred. Error code is: UNKNOWN XA EXCEPTION CODE (0). Exception is: Could not read resultset: unexpected end of stream, read 0 bytes from 4
[10/16/15 8:00:12:094 UTC] 000234d6 com.ibm.tx.jta.impl.RegisteredResources E WTRN0078E: An attempt by the transaction manager to call start on a transactional resource has resulted in an error. The error code was XA_OK. The exception stack trace follows: javax.transaction.xa.XAException: Could not read resultset: unexpected end of stream, read 0 bytes from 4
at org.mariadb.jdbc.MySQLXAResource.mapXAException(MySQLXAResource.java:43)
at org.mariadb.jdbc.MySQLXAResource.execute(MySQLXAResource.java:51)
at org.mariadb.jdbc.MySQLXAResource.start(MySQLXAResource.java:151)
at com.ibm.ws.rsadapter.spi.WSRdbXaResourceImpl.start(WSRdbXaResourceImpl.java:1189)
at com.ibm.ejs.j2c.XATransactionWrapper.start(XATransactionWrapper.java:1281)
at com.ibm.ws.Transaction.JTA.JTAResourceBase.start(JTAResourceBase.java:157)
at com.ibm.tx.jta.impl.RegisteredResources.startRes(RegisteredResources.java:1000)
at com.ibm.tx.jta.impl.RegisteredResources.enlistResource(RegisteredResources.java:642)
at com.ibm.tx.jta.impl.TransactionImpl.enlistResource(TransactionImpl.java:2359)
at com.ibm.tx.jta.embeddable.impl.EmbeddableTranManagerSet.enlist(EmbeddableTranManagerSet.java:157)
at com.ibm.ws.transaction.services.TransactionManagerService.enlist(TransactionManagerService.java:370)
at com.ibm.ejs.j2c.XATransactionWrapper.enlist(XATransactionWrapper.java:596)
at com.ibm.ejs.j2c.ConnectionManager.lazyEnlist(ConnectionManager.java:2165)
at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.lazyEnlist(WSRdbManagedConnectionImpl.java:2181)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.beginTransactionIfNecessary(WSJdbcConnection.java:493)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.java:2188)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.java:2154)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:162)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:186)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:160)
at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.prepareQueryStatement(AbstractLoadPlanBasedLoader.java:257)
at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeQueryStatement(AbstractLoadPlanBasedLoader.java:201)
at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeLoad(AbstractLoadPlanBasedLoader.java:137)
at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeLoad(AbstractLoadPlanBasedLoader.java:102)
at org.hibernate.loader.entity.plan.AbstractLoadPlanBasedEntityLoader.load(AbstractLoadPlanBasedEntityLoader.java:186)
at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:4126)
at org.hibernate.event.internal.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:503)
at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:468)
at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:213)
at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:275)
at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:151)
at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1106)
让我添加一个新的堆栈跟踪:
[App/0]ERR at org.mariadb.jdbc.MySQLXAResource.mapXAException(MySQLXAResource.java:43)
[App/0]ERR at org.mariadb.jdbc.MySQLXAResource.execute(MySQLXAResource.java:51)
[App/0]ERR at org.mariadb.jdbc.MySQLXAResource.start(MySQLXAResource.java:151)
[App/0]ERR[ERROR ] WTRN0078E: An attempt by the transaction manager to call start on a transactional resource has resulted in an error. The error code was XA_OK. The exception stack trace follows: javax.transaction.xa.XAException: Could not read resultset: unexpected end of stream, read 0 bytes from 4
[App/0]ERR at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:151)
[App/0]ERR at java.lang.reflect.Method.invoke(Unknown Source)
[App/0]ERR at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[App/0]ERR at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:4126)
[App/0]ERR at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeLoad(AbstractLoadPlanBasedLoader.java:137)
[App/0]ERR at com.ibm.ws.rsadapter.spi.WSRdbXaResourceImpl.start(WSRdbXaResourceImpl.java:1189)
[App/0]ERR at com.servengine.application.ejb.EJSLocalNSGApplicationManagerBean_04c55490.getBooleanPropertyValue(EJSLocalNSGApplicationManagerBean_04c55490.java)
[App/0]ERR at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[App/0]ERR at org.hibernate.internal.SessionImpl.get(SessionImpl.java:991)
[App/0]ERR at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:213)
[App/0]ERR at com.servengine.application.ejb.ApplicationManagerBean.getPropertyValue(ApplicationManagerBean.java:227)
[App/0]ERR at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:186)
[App/0]ERR at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.load(SessionImpl.java:2587)
[App/0]ERR at [internal classes]
[App/0]ERR at com.servengine.servlet.EncodingFilter.doFilter(EncodingFilter.java:44)
[App/0]ERR at org.hibernate.jpa.spi.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:1068)
[App/0]ERR at com.servengine.servlet.ServengineWebFilter.doFilter(ServengineWebFilter.java:144)
[App/0]ERR at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeQueryStatement(AbstractLoadPlanBasedLoader.java:201)
[App/0]ERR at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:275)
[App/0]ERR at org.hibernate.loader.entity.plan.AbstractLoadPlanBasedEntityLoader.load(AbstractLoadPlanBasedEntityLoader.java:186)
[App/0]ERR at com.servengine.application.ejb.ApplicationManagerBean.getProperty(ApplicationManagerBean.java:179)
[App/0]ERR at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:207)
[App/0]ERR at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:162)
[App/0]ERR at java.lang.reflect.Method.invoke(Unknown Source)
[App/0]ERR at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:66)
[App/0]ERR at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:207)
[App/0]ERR at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[App/0]ERR at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[App/0]ERR at com.ibm.ejs.container.EJSContainer.invokeProceed(EJSContainer.java:5323)
[App/0]ERR at com.servengine.application.ejb.ApplicationManagerBean.getBooleanPropertyValue(ApplicationManagerBean.java:279)
[App/0]ERR at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:179)
[App/0]ERR at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[App/0]ERR at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[App/0]ERR at com.ibm.ws.jpa.management.JPATxEmInvocation.find(JPATxEmInvocation.java:215)
[App/0]ERR at [internal classes]
[App/0]ERR at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1106)
[App/0]ERR at [internal classes]
[App/0]ERR at [internal classes]
[App/0]ERR at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.prepareQueryStatement(AbstractLoadPlanBasedLoader.java:257)
[App/0]ERR at org.hibernate.jpa.spi.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:1110)
[App/0]ERR at org.hibernate.event.internal.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:503)
[App/0]ERR at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeLoad(AbstractLoadPlanBasedLoader.java:102)
[App/0]ERR at org.hibernate.internal.SessionImpl.access$2000(SessionImpl.java:176)
[App/0]ERR at com.servengine.openid.OpenIDLoginView.isOpenIDEnabled(OpenIDLoginView.java:123)
[App/0]ERR at javax.el.BeanELResolver.getValue(BeanELResolver.java:98)
[App/0]ERR at [internal classes]
[App/0]ERR at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:468)
[App/0]ERR at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:160)
[App/0]ERR at [internal classes]