[
https://issues.apache.org/jira/browse/FINERACT-1061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17148279#comment-17148279
]
Petri Tuomola commented on FINERACT-1061:
-----------------------------------------
[~vorburger] I think the code is supposed to implement one logic if the
ResultSet is empty, and another logic if it is not. The problem is that when
you call rs.next() to find out if the ResultSet is empty, it advances the
cursor so you need to back up one row - which is not supported. But this is
easily solved by changing the while loop to do-while - will send a PR.
> Operation not allowed for a result set of type ResultSet.TYPE_FORWARD_ONLY in
> ProductMixReadPlatformServiceImpl.retrieveAllProductMixes()
> -----------------------------------------------------------------------------------------------------------------------------------------
>
> Key: FINERACT-1061
> URL: https://issues.apache.org/jira/browse/FINERACT-1061
> Project: Apache Fineract
> Issue Type: Bug
> Reporter: Michael Vorburger
> Priority: Blocker
> Labels: beginner
> Fix For: 1.4.0
>
>
> See FINERACT-932 for general background, and fix this problem:
> {code}org.springframework.dao.TransientDataAccessResourceException:
> PreparedStatementCallback; SQL [Select pm.product_id as productId, lp.name as
> name from m_product_mix pm join m_product_loan lp on lp.id=pm.product_id
> group by pm.product_id]; Operation not allowed for a result set of type
> ResultSet.TYPE_FORWARD_ONLY.; nested exception is java.sql.SQLException:
> Operation not allowed for a result set of type ResultSet.TYPE_FORWARD_ONLY.
> at
> org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate
> (SQLStateSQLExceptionTranslator.java:110)
> at
> org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate
> (AbstractFallbackSQLExceptionTranslator.java:72)
> at
> org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate
> (AbstractFallbackSQLExceptionTranslator.java:81)
> at
> org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate
> (AbstractFallbackSQLExceptionTranslator.java:81)
> at org.springframework.jdbc.core.JdbcTemplate.translateException
> (JdbcTemplate.java:1443)
> at org.springframework.jdbc.core.JdbcTemplate.execute
> (JdbcTemplate.java:633)
> at org.springframework.jdbc.core.JdbcTemplate.query
> (JdbcTemplate.java:669)
> at org.springframework.jdbc.core.JdbcTemplate.query
> (JdbcTemplate.java:700)
> at org.springframework.jdbc.core.JdbcTemplate.query
> (JdbcTemplate.java:718)
> at
> org.apache.fineract.portfolio.loanproduct.productmix.service.ProductMixReadPlatformServiceImpl.retrieveAllProductMixes
> (ProductMixReadPlatformServiceImpl.java:82){code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)