2 Replies Latest reply on Feb 28, 2003 7:17 AM by chriskn1

    BigDecimal/Postgres in V3.04

    chriskn1

      Hi

      Although there appears to have been some discussion on BigDecimal in other topics, I cannot seem to find an answer to my problem. Basically, I have just converted from V3.00 to V3.04, and although persistence (insert/update) of BigDecimal fields appear to work fine with my Postgres DB (v7.1.3), when I READ a BigDecimal field through an entity bean, I get a null value. The strange thing is that this works all fine under v3.00.

      I have checked my mapping's in the standardjbosscmp-jdbc.xml, and they appear to be correct (as follows):


      <java-type>java.math.BigDecimal</java-type>
      <jdbc-type>NUMERIC</jdbc-type>
      <sql-type>NUMERIC</sql-type>


      I am using "PostgreSQL 7.2" as my type-mapping. My BigDecimal field is being stored in a Numeric(15,2) field in Postgres.

      I cannot seem to find any real differences between the xml cmp files for V3.00 and V3.04. They all appear to be the same for both versions.

      Does anyone have any ideas as to what I can do?

      Regards
      Chris

        • 1. Re: BigDecimal/Postgres in V3.04
          chriskn1

          Hi
          Actually, the info I have given is completely true. The situation described above only exists if the actual field in the db contains decimalised numbers eg. 2.5

          If however, the field contains integers or equivalents (eg. 5 or 5.00), then this is correctly read.

          Hope this clarifies my problem.

          Regards
          Chris

          • 2. Re: BigDecimal/Postgres in V3.04
            chriskn1

            Hi

            I have now solved this problem - I upgraded to the latest Postgres (V7.3.2), and this seems to have sorted the problem out.

            Regards
            Chris