1 Reply Latest reply on Jun 26, 2005 1:32 PM by Darran Lofthouse

    Unknown pk works but a CreateException is thrown

    Flush Newbie

      Hi, I'm using automatic pk with MySQL. The entity bean declares the unknown pk, the records gets added, but after each .create() method the application server comes back with a CreateException, because the key was null.

      I don't think this is the correct behaviour, because an EJB should be independent from the underlying database. With Jboss I have to ignore the CreateException because the database is written correctly, but following the specs I shouldn't. I mean, if a CreateException was thrown during the create() method, it means that something went wrong during creation.

      The Javadoc about the CreateException says that this exception is thrown if an error occurred while creating the record. But in the case of unknown pk this is not true, as an error didn't actually occur.