You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Adrian Crum (JIRA)" <ji...@apache.org> on 2014/03/11 17:49:45 UTC

[jira] [Assigned] (OFBIZ-5214) Different column sorting in entitymodel.xml and database causes PSQLException

     [ https://issues.apache.org/jira/browse/OFBIZ-5214?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adrian Crum reassigned OFBIZ-5214:
----------------------------------

    Assignee:     (was: Adrian Crum)

> Different column sorting in entitymodel.xml and database causes PSQLException
> -----------------------------------------------------------------------------
>
>                 Key: OFBIZ-5214
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5214
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Kevin Tunstall
>         Attachments: OFBIZ-5214.patch
>
>
> Due to r1486552, different column sorting in entitymodel.xml and database now causes a PSQLException, when an entity is selected without any selectFields. The index of the column in entitymodel.xml may not correspond to the index of the column in the database. Before r1486552, a select with all fields names instead of a "select *" was used.
> Example stacktrace:
> {quote}
> 2013-06-07 14:20:32,937 (main) [      EntityListIterator:346:WARN ] [ ] [] Warning: auto-closed EntityListIterator because of exception: org.ofbiz.entity.GenericDataSourceException: SQL Exception while getting value : oldAmountPerQuantity [AMOUNT_PER_QUANTITY] (33) (Bad value for type BigDecimal : 2013-06-07 14:20:32.306+02)
> 2013-06-07 14:20:32,941 (main) [        GenericDelegator:1812:ERROR] [ ] [] 
> ---- exception report ----------------------------------------------------------
> Failure in findByCondition operation for entity [OrderAdjustment]: org.ofbiz.entity.GenericEntityException: Error creating GenericValue (SQL Exception while getting value : oldAmountPerQuantity [AMOUNT_PER_QUANTITY] (33) (Bad value for type BigDecimal : 2013-06-07 14:20:32.306+02)). Rolling back transaction.
> Exception: org.ofbiz.entity.GenericEntityException
> Message: Error creating GenericValue (SQL Exception while getting value : oldAmountPerQuantity [AMOUNT_PER_QUANTITY] (33) (Bad value for type BigDecimal : 2013-06-07 14:20:32.306+02))
> ---- cause ---------------------------------------------------------------------
> Exception: org.ofbiz.entity.GenericDataSourceException
> Message: SQL Exception while getting value : oldAmountPerQuantity [AMOUNT_PER_QUANTITY] (33) (Bad value for type BigDecimal : 2013-06-07 14:20:32.306+02)
> ---- cause ---------------------------------------------------------------------
> Exception: org.postgresql.util.PSQLException
> Message: Bad value for type BigDecimal : 2013-06-07 14:20:32.306+02
> ---- stack trace ---------------------------------------------------------------
> org.postgresql.util.PSQLException: Bad value for type BigDecimal : 2013-06-07 14:20:32.306+02
> org.postgresql.jdbc2.AbstractJdbc2ResultSet.toBigDecimal(AbstractJdbc2ResultSet.java:2816)
> org.postgresql.jdbc2.AbstractJdbc2ResultSet.getBigDecimal(AbstractJdbc2ResultSet.java:2237)
> org.postgresql.jdbc2.AbstractJdbc2ResultSet.getBigDecimal(AbstractJdbc2ResultSet.java:323)
> org.apache.commons.dbcp.DelegatingResultSet.getBigDecimal(DelegatingResultSet.java:340)
> org.apache.commons.dbcp.DelegatingResultSet.getBigDecimal(DelegatingResultSet.java:340)
> org.ofbiz.entity.jdbc.SqlJdbcUtil.getValue(SqlJdbcUtil.java:692)
> org.ofbiz.entity.util.EntityListIterator.currentGenericValue(EntityListIterator.java:178)
> org.ofbiz.entity.util.EntityListIterator.next(EntityListIterator.java:325)
> org.ofbiz.entity.util.EntityListIterator.getCompleteList(EntityListIterator.java:439)
> org.ofbiz.entity.GenericDelegator.findList(GenericDelegator.java:1802)
> org.ofbiz.entity.GenericDelegator.findByAnd(GenericDelegator.java:1735)
> org.ofbiz.entity.Delegator$findByAnd.call(Unknown Source)
> {quote}
> Here, the column actually read from the database was a date, but the column used  in the JdbcValueHandler is a BigDecimal.



--
This message was sent by Atlassian JIRA
(v6.2#6252)