5 Replies Latest reply on Aug 5, 2005 2:54 PM by Denis Souza

    Problem with persistence in EJB3 RC1(bug?)

    Denis Souza Newbie


      I ran my test suite on EJB3 RC1 and it failed. I think it might be a bug.

      I have an entity bean with an ID declared as:

       @Id(generate = GeneratorType.SEQUENCE, generator = "MySequence")
       @SequenceGenerator(name = "MySequence", sequenceName = "MY_SEQ")
       public Integer getId() {

      At some point I'm persisting the bean by calling the entity manager's persist() method. After that I need to delete the object from the database but I can't since getId() is now returning null even after the object is persisted.
      The sequence is working and the row is being inserted into the database without any problems.
      In previous versions, immediately after the call to persist(), I'd be able to call getId() on my entity bean and use it for any needed purpose. Is this behaviour correct? Is it a bug?

      I'm using EJB 3 RC1 on JBoss 4.0.3RC1 and Oracle 10g.

      Denis Souza