1 Reply Latest reply on May 28, 2010 1:52 PM by kmranganathan

    Custom Homw with JPA


      For one of my screens, I have written a custom Home (which extends PersistenceController - have to overload the getPersistenceConextName)
      I get the EntityManager by calling super.getPersistenceContext().

      Now, when I try to persist() an entity, it doesn't save the record - there are no errors (even with @Transactional). When I try to include a call to flush() after persist(), it says 'no transaction in progress'. When I then try to call getTransaction(), it throws an error saying, 'JTA Transaction can't be invoked this way'.

      Is flush() compulsory? why doesn't it persist with just the persist() call. Its only one entity, so, I don't need transaction actually.
      Please let me know the way out of this.