2 Replies Latest reply on Mar 12, 2009 12:24 PM by Martin Heinemann

    Jboss modifies sql.date object in serialisation process

    Martin Heinemann Newbie

      Hi,

      i have a weird problem.
      I'm using JBoss 4.0.5 GA and EJB3.

      I hav a java.sql.Date object in my Swing client (14/11/1968). This is attached to an entity and send to the server. No happens the strange thing.
      When i inspect the object that arrives in the session bean, the date object points to the date 13/11/1968!!! Where is that day gone?


      I noticed some behavior. The sql date is generated from an util date in that way:

      new java.sql.Date(myUtilDate.getTime())
      


      the day-loss happens, if "myUtilDate" is 14/11/1968 00:00:00.

      If "myUtilDate" is 14/11/1968 15:34:12, everything is fine and the right date is stored in the database.
      Does anyone have an idea what is happening here?

      Database ist PostgreSQL 8.3 and the date is stored in a "date" column.

      greetings

      Martin