Hello all.
I have upgraded a Struts 2.0.11 project to 2.1.8, and I have some strange behavior. The Struts stuff seems to work fine, and the Ajax stuff works fine as well. The Hibernate stuff works as far as reading data is concerned. But when I try to write a record, nothing happens on the database and I get no exception thrown, and I get no errors in the log.
For instance, whenever a user logs in, a LoginHistory object is created, and subsequently written to the login_history table in Postgres. The application is using the EntityManager to persist a new object. The code is simple; the LoginHistoryService class says:
public void persist(LoginHistory loginHistory) { try { System.out.println("About to insert login_history record") ; entityManager.persist(loginHistory); System.out.println("Done inserting login_history record") ; } catch (Exception ex) { System.out.println(ex.getMessage() ) ; } }
I see the two logged messages, and in stepping through with a debugger, the persist statement *seems* to be done, but nothing appears in the database.
Also, when changing a User's account data, nothing winds up in Postgres. The UserService class says:
public void merge(User user) { try { entityManager.merge(user); } catch (Exception ex) { System.out.println(ex.getMessage() ) ; } }
But the record is never changed.
I had been using 3.2.1.ga versions of hibernate, hibernate_annotations, and hibernate-entitymanager. I thought I might have needed to upgrade, so I went to the latest and greatest (3.3.2 of hibernate, 3.4.0 of annotations and entitymanager), but the behavior (or the lack of it) is the same.
As I sit here pulling my hair out, does anyone remember seeing anything like this?
Thanks, Tom
|