1 Reply Latest reply on Jan 6, 2004 1:28 PM by richaosu

    Got unwanted SQL updates on date columns when reading a coll

    brailateo

      Using JBoss 3.2.3 FINAL on a Linux Mandrake 9.1 machine with JSun 2SDK1.4.2_03 and PostgreSQL 7.3.2

      I'm iterating over a EJB Collection (Local interface) generated by a finder in a Stateless session bean. My table contains a DATE field. Strangely, my PostgreSQL is receiving SQL commands that try to update a DATE field in my table with (apparently) the same date as the row holds.

      I got the following:
      UPDATE factura SET datafactura='2003-12-19' WHERE id='73' for each row in the collection.

      The same problem but with fatal results were when I used a EJB Bean mapped on a faked table (actually a view) and it tried to update the date field. In order to get it work I declared the EJB as read-only (no problem).

      I suspect a problem for JBoss in computing the "dirty" flag for my EJB, possible due to approximation for java.lang.Date and java.sql.Timestamp.

      Do you have a workarround in order to eliminate those unwanted and unnecessary UPDATES?

      Constantin Teodorescu
      Braila, ROMANIA
      E-mail: teo@flex.ro