SmartClient Version: v10.0p_2015-07-30/PowerEdition Deployment (built 2015-07-30)
Isomorphic SmartClient/SmartGWT Framework (v10.0p_2015-07-30/PowerEdition Deployment 2015-07-30)
Browser: Chrome
This is a server side issue
We have a customer who is regularly failing during database access with a Cursor state not valid error. In most cases, SmartGWT is able to do a retry and the process completes. However, often the process will end in error during the attempt to retry, sending an error dialog back to the user.
The failing error is happening when com.isomorphic.sql.SQLConnectionManager attempts to free the connection in preparation for the next attempt.
The "Cursor state not valid" error always seems to folow this debug message:
DEBUG SQLTransform - [builtinApplication.fetchWithPackReconciliation] isBeforeFirst()/isAfterLast() throwing exceptions - attempting workaround
Im including two examples of the server log, one that fails and another that appears to recover. For clarity, Ive isolated only the log messages from the thread thats experiencing the error. If you need more, please let me know.
Though the "Cursor state not valid error" is a concern, the biggest worry is when the recovery results in an error that is working its way back to the user. Based on the log, it appears that query eventually goes through, though I cant tell for certain.
Thanks.
From server.properties
This is an example that fails, leading to an error message sent to the user.
Here's an example that appears to recover without an error being sent to the user:
Isomorphic SmartClient/SmartGWT Framework (v10.0p_2015-07-30/PowerEdition Deployment 2015-07-30)
Browser: Chrome
This is a server side issue
We have a customer who is regularly failing during database access with a Cursor state not valid error. In most cases, SmartGWT is able to do a retry and the process completes. However, often the process will end in error during the attempt to retry, sending an error dialog back to the user.
The failing error is happening when com.isomorphic.sql.SQLConnectionManager attempts to free the connection in preparation for the next attempt.
The "Cursor state not valid" error always seems to folow this debug message:
DEBUG SQLTransform - [builtinApplication.fetchWithPackReconciliation] isBeforeFirst()/isAfterLast() throwing exceptions - attempting workaround
Im including two examples of the server log, one that fails and another that appears to recover. For clarity, Ive isolated only the log messages from the thread thats experiencing the error. If you need more, please let me know.
Though the "Cursor state not valid error" is a concern, the biggest worry is when the recovery results in an error that is working its way back to the user. Based on the log, it appears that query eventually goes through, though I cant tell for certain.
Thanks.
From server.properties
Code:
sql.iptsfil.database.type: db2iSeries sql.iptsfil.interface.type: driverManager sql.iptsfil.driver: com.ibm.as400.access.AS400JDBCDriver sql.iptsfil.driver.url: jdbc:as400://host;naming=system;prompt=false;user=XXXXXX;password=XXXXXX;libraries=LIBRARY1,LIBRARY2,LIBRARY3;translate binary=true sql.iptsfil.autoJoinTransactions: false sql.iptsfil.defaultDateType: date sql.iptsfil.trimTextFields: true sql.iptsfil.naming: system
Code:
=== 2016-03-29 11:15:13,442 [c-10] INFO IpIDACall - Processing DataSource ShippingTerms === 2016-03-29 11:15:13,443 [c-10] INFO SQLDataSource - [builtinApplication.ShippingTerms_fetch] Performing fetch operation with criteria: {} values: {} === 2016-03-29 11:15:13,444 [c-10] INFO SQLWhereClause - [builtinApplication.ShippingTerms_fetch] empty condition === 2016-03-29 11:15:13,444 [c-10] INFO SQLDataSource - [builtinApplication.ShippingTerms_fetch] derived query: SELECT $defaultSelectClause FROM ShippingTerms left join IPFDSTD on ShippingTerms.rateTable=IPFDSTD.QCOD WHERE $defaultWhereClause === 2016-03-29 11:15:13,444 [c-10] INFO SQLDataSource - [builtinApplication.ShippingTerms_fetch] 2468: Executing SQL query on 'iptsfil': SELECT ShippingTerms.id, ShippingTerms.name, ShippingTerms.incoterm, ShippingTerms.rateTable, IPFDSTD.QDES, ShippingTerms.isDeprecated, 9 AS inUse, 9 AS isNotDeprecatedOrIsInPo, IPFDSTD.QFDQ01, IPFDSTD.QFDY01, IPFDSTD.QFDV01 FROM ShippingTerms left join IPFDSTD on ShippingTerms.rateTable=IPFDSTD.QCOD WHERE ('1'='1') === 2016-03-29 11:15:13,444 [c-10] DEBUG SQLConnectionManager - [builtinApplication.ShippingTerms_fetch] Borrowed connection '1588800931' === 2016-03-29 11:15:13,444 [c-10] DEBUG SQLDriver - [builtinApplication.ShippingTerms_fetch] About to execute SQL query in 'iptsfil' using connection '1588800931' === 2016-03-29 11:15:13,444 [c-10] INFO SQLDriver - [builtinApplication.ShippingTerms_fetch] Executing SQL query on 'iptsfil': SELECT ShippingTerms.id, ShippingTerms.name, ShippingTerms.incoterm, ShippingTerms.rateTable, IPFDSTD.QDES, ShippingTerms.isDeprecated, 9 AS inUse, 9 AS isNotDeprecatedOrIsInPo, IPFDSTD.QFDQ01, IPFDSTD.QFDY01, IPFDSTD.QFDV01 FROM ShippingTerms left join IPFDSTD on ShippingTerms.rateTable=IPFDSTD.QCOD WHERE ('1'='1') === 2016-03-29 11:15:13,509 [c-10] DEBUG SQLTransform - [builtinApplication.ShippingTerms_fetch] isBeforeFirst()/isAfterLast() throwing exceptions - attempting workaround === 2016-03-29 11:15:13,509 [c-10] INFO SQLDriver - [builtinApplication.ShippingTerms_fetch] Execute of select: SELECT ShippingTerms.id, ShippingTerms.name, ShippingTerms.incoterm, ShippingTerms.rateTable, IPFDSTD.QDES, ShippingTerms.isDeprecated, 9 AS inUse, 9 AS isNotDeprecatedOrIsInPo, IPFDSTD.QFDQ01, IPFDSTD.QFDY01, IPFDSTD.QFDV01 FROM ShippingTerms left join IPFDSTD on ShippingTerms.rateTable=IPFDSTD.QCOD WHERE ('1'='1') on db: iptsfil threw exception: java.sql.SQLException: Cursor state not valid. - assuming stale connection and retrying query. === 2016-03-29 11:15:13,509 [c-10] DEBUG SQLConnectionManager - [builtinApplication.ShippingTerms_fetch] About to close connection with hashcode "1588800931" === 2016-03-29 11:15:13,533 [c-10] DEBUG SQLConnectionManager - [builtinApplication.ShippingTerms_fetch] Really closing and invalidating PoolableConnection with hashcode "1588800931" === 2016-03-29 11:15:13,598 [c-10] ERROR SQLConnectionManager - [builtinApplication.ShippingTerms_fetch] Error attempting to commit and close a connection java.lang.NullPointerException at com.isomorphic.sql.SQLConnectionManager.free(SQLConnectionManager.java:313) at com.isomorphic.sql.SQLDriver.getTransformedResults(SQLDriver.java:688) at com.isomorphic.sql.SQLDriver.executeQuery(SQLDriver.java:1013) at com.isomorphic.sql.SQLDataSource.executeNativeQuery(SQLDataSource.java:559) at com.isomorphic.sql.SQLDataSource.executeNativeQuery(SQLDataSource.java:553) at com.isomorphic.sql.SQLDataSource.SQLExecute(SQLDataSource.java:1927) at com.isomorphic.sql.SQLDataSource.processRequest(SQLDataSource.java:444) at com.isomorphic.sql.SQLDataSource.executeFetch(SQLDataSource.java:389) at com.islandpacific.gui.server.customDataSource.ShippingTermsDS.executeFetch(ShippingTermsDS.java:37) at com.isomorphic.datasource.DataSource.execute(DataSource.java:1922) at com.islandpacific.gui.server.customDataSource.IpDataSource.getResponse(IpDataSource.java:375) at com.islandpacific.gui.server.customDataSource.IpDataSource.execute(IpDataSource.java:151) at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:726) at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:658) at com.isomorphic.application.AppBase.execute(AppBase.java:491) at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:2548) at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:220) at com.islandpacific.gui.server.customDataSource.IpIDACall.handleDSRequest(IpIDACall.java:117) at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:185) at com.islandpacific.gui.server.customDataSource.IpIDACall.processRPCTransaction(IpIDACall.java:67) at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:152) at com.isomorphic.servlet.IDACall._processRequest(IDACall.java:117) at com.isomorphic.servlet.IDACall.doPost(IDACall.java:76) at javax.servlet.http.HttpServlet.service(HttpServlet.java:647) at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:156) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:343) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:188) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) at com.islandpacific.gui.security.IpConcurrentSessionFilter.doFilter(IpConcurrentSessionFilter.java:55) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:149) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at com.isomorphic.servlet.CompressionFilter._doFilter(CompressionFilter.java:260) at com.isomorphic.servlet.BaseFilter.doFilter(BaseFilter.java:83) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:947) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1009) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) === 2016-03-29 11:15:13,619 [c-10] DEBUG PoolableSQLConnectionFactory - [builtinApplication.ShippingTerms_fetch] makeObject() created a pooled Connection '1588800931' === 2016-03-29 11:15:13,640 [c-10] INFO DSResponse - [builtinApplication.ShippingTerms_fetch] DSResponse: List with 1 items === 2016-03-29 11:15:13,643 [c-10] DEBUG SQLDriver - Freeing SQLDriver dbConnection 138375065 === 2016-03-29 11:15:13,643 [c-10] DEBUG SQLConnectionManager - About to close connection with hashcode "138375065" === 2016-03-29 11:15:13,643 [c-10] DEBUG SQLDriver - Freeing SQLDriver dbConnection 1101562616 === 2016-03-29 11:15:13,643 [c-10] DEBUG SQLConnectionManager - About to close connection with hashcode "1101562616" === 2016-03-29 11:15:13,643 [c-10] DEBUG SQLDriver - Freeing SQLDriver dbConnection 1588800931 === 2016-03-29 11:15:13,643 [c-10] DEBUG SQLConnectionManager - About to close connection with hashcode "1588800931" === 2016-03-29 11:15:13,644 [c-10] INFO Compression - /ipgui/ipgui/sc/IDACall: 16077 -> 2935 bytes
Code:
=== 2016-03-29 11:19:49,931 [ec-8] INFO SQLDataSource - [builtinApplication.fetchWithPackReconciliation] Performing fetch operation with criteria: {parentId:"40"} values: {parentId:"40"} === 2016-03-29 11:19:49,932 [ec-8] INFO SQLDataSource - [builtinApplication.fetchWithPackReconciliation] derived query: SELECT ProductionLineVariant.*,ProductionLineVariant.color as itemColor, ProductionLineVariant.size AS itemSize, IFNULL(i.ISKU, 0) as itemSku, (CURDATE()-IFNULL(i.ixdi,CURDATE())) as daysSinceItemCreated FROM ProductionLineVariant INNER JOIN productionline l ON ProductionLineVariant.parentid=l.id LEFT JOIN ipithdr i ON i.isty = l.itemStyle AND i.icls = l.itemClass AND i.iven = l.itemVendor AND i.iclr = ProductionLineVariant.color AND i.isiz = ProductionLineVariant.size WHERE $defaultWhereClause ORDER BY itemColor, itemSize === 2016-03-29 11:19:49,932 [ec-8] INFO SQLDataSource - [builtinApplication.fetchWithPackReconciliation] 3586: Executing SQL query on 'iptsfil': SELECT ProductionLineVariant.*,ProductionLineVariant.color as itemColor, ProductionLineVariant.size AS itemSize, IFNULL(i.ISKU, 0) as itemSku, (CURDATE()-IFNULL(i.ixdi,CURDATE())) as daysSinceItemCreated FROM ProductionLineVariant INNER JOIN productionline l ON ProductionLineVariant.parentid=l.id LEFT JOIN ipithdr i ON i.isty = l.itemStyle AND i.icls = l.itemClass AND i.iven = l.itemVendor AND i.iclr = ProductionLineVariant.color AND i.isiz = ProductionLineVariant.size WHERE (ProductionLineVariant.parentId=40) ORDER BY itemColor, itemSize === 2016-03-29 11:19:49,932 [ec-8] DEBUG SQLConnectionManager - [builtinApplication.fetchWithPackReconciliation] Borrowed connection '1101562616' === 2016-03-29 11:19:49,932 [ec-8] DEBUG SQLDriver - [builtinApplication.fetchWithPackReconciliation] About to execute SQL query in 'iptsfil' using connection '1101562616' === 2016-03-29 11:19:49,932 [ec-8] INFO SQLDriver - [builtinApplication.fetchWithPackReconciliation] Executing SQL query on 'iptsfil': SELECT ProductionLineVariant.*,ProductionLineVariant.color as itemColor, ProductionLineVariant.size AS itemSize, IFNULL(i.ISKU, 0) as itemSku, (CURDATE()-IFNULL(i.ixdi,CURDATE())) as daysSinceItemCreated FROM ProductionLineVariant INNER JOIN productionline l ON ProductionLineVariant.parentid=l.id LEFT JOIN ipithdr i ON i.isty = l.itemStyle AND i.icls = l.itemClass AND i.iven = l.itemVendor AND i.iclr = ProductionLineVariant.color AND i.isiz = ProductionLineVariant.size WHERE (ProductionLineVariant.parentId=40) ORDER BY itemColor, itemSize === 2016-03-29 11:19:50,017 [ec-8] DEBUG SQLTransform - [builtinApplication.fetchWithPackReconciliation] isBeforeFirst()/isAfterLast() throwing exceptions - attempting workaround === 2016-03-29 11:19:50,017 [ec-8] INFO SQLDriver - [builtinApplication.fetchWithPackReconciliation] Execute of select: SELECT ProductionLineVariant.*,ProductionLineVariant.color as itemColor, ProductionLineVariant.size AS itemSize, IFNULL(i.ISKU, 0) as itemSku, (CURDATE()-IFNULL(i.ixdi,CURDATE())) as daysSinceItemCreated FROM ProductionLineVariant INNER JOIN productionline l ON ProductionLineVariant.parentid=l.id LEFT JOIN ipithdr i ON i.isty = l.itemStyle AND i.icls = l.itemClass AND i.iven = l.itemVendor AND i.iclr = ProductionLineVariant.color AND i.isiz = ProductionLineVariant.size WHERE (ProductionLineVariant.parentId=40) ORDER BY itemColor, itemSize on db: iptsfil threw exception: java.sql.SQLException: Cursor state not valid. - assuming stale connection and retrying query. === 2016-03-29 11:19:50,017 [ec-8] DEBUG SQLConnectionManager - [builtinApplication.fetchWithPackReconciliation] Connection 1101562616 was already closed when we came to free it === 2016-03-29 11:19:50,293 [ec-8] DEBUG PoolableSQLConnectionFactory - [builtinApplication.fetchWithPackReconciliation] makeObject() created a pooled Connection '1773990153' === 2016-03-29 11:19:50,365 [ec-8] INFO DSResponse - [builtinApplication.fetchWithPackReconciliation] DSResponse: List with 20 items === 2016-03-29 11:19:50,366 [ec-8] DEBUG SQLDriver - Freeing SQLDriver dbConnection 1773990153 === 2016-03-29 11:19:50,366 [ec-8] DEBUG SQLConnectionManager - About to close connection with hashcode "1773990153"
Comment