5 Replies Latest reply on Sep 16, 2003 3:50 PM by Gerald Turner

    Null CMR fields broken in 3.2.0 RC2?

    Carl Schmidt Newbie

      Hey there,

      I figured I would try updating from 3.2.0 RC1 to RC2. I have an existing EJB app that works fine on RC1 (on top of MySQL 4.x). However, when running on RC2, I get the following exception after creating a CMP EJB with a many-to-one relationship, where the relationship field is set to null:

      TransactionRolledbackLocalException, causedBy:
      javax.ejb.NoSuchObjectLocalException: Entity not found: primaryKey=[.0.]


      In RC1, whenever a CMR field on the one-side of the relationship is NULL, the foreign key field is set to a null value. However, in RC2, it's set to "0"! In the following queries captured from the MySQL log, the alwaysSendListID value should be NULL, but it gets set to 0 instead:

      INSERT INTO Campaigns (dateCreated, description, alwaysSendListID, qaListID) VALUES (null, null, null, null)
      UPDATE Campaigns SET description='Newsletter', alwaysSendListID=0, qaListID=0 WHERE campaignID=1
      UPDATE Campaigns SET qaListID=3 WHERE campaignID=1


      In RC1, things worked like this:

      INSERT INTO Campaigns (dateCreated, description, qaListID, alwaysSendListID) VALUES (null, null, null, null)
      UPDATE Campaigns SET description='test 2' WHERE campaignID=5
      UPDATE Campaigns SET qaListID=2 WHERE campaignID=5


      Notice that in the UPDATE statement following the INSERT, RC1 does *not* include the foreign key values, whereas RC2 includes 0 values. This looks broken to me...

      - Carl