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.
I need some help on this, please.