Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
Ranganathan Kaliyur Mannar wrote:Why do have so many calls to 'entityManager.getTransaction().begin()' ?
and you re calling begin even after a 'rollback' or 'commit' is done...
as for the rollback issues, I think you can do a entityManager.refresh for that entity which should then have the correct data which will be reflected in the JTable...
Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
Ranganathan Kaliyur Mannar wrote:First of all, where is the call to refresh()? It should be called whenever an exception occurs and rollback has happened.
More importantly, you need not refresh the entire contents. Just refresh the entity that you are referring to (i.e the one you tried to save and rolled back). And normally, whenever the table data model is changed, it would call its fireXXX methods to notify the JTable to update itself. You need to see if that happens in this case.
Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
Ranganathan Kaliyur Mannar wrote:Hi,
I looked at the code. Basically, the list is being added to and removed for the table to refresh. So, if you are doing a rollback, call em.refresh() for that entity and then remove that object from the list and add it again to the list. This should refresh the table.
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |