I noticed a new problem with the hibernate module.

Currently it is completely correct to use a session outside of a given
transaction since Tapestry starts a new one.

The coworker did following things:

service.createUser();
service.createUserProfile();

works.

So now it was my turn so I used the createUser to create a admin but a
admin does not need a profile so I did not used it. Guess what nothing
happend.

Turned out that he missed the opportunity to annotate createUser
accordingly with CommitAfter.

Since createUserProfile was marked correctly the first transaction that is
created is also committed at the end of the second one. But standing alone
nothing is done (at the end its rolled back).

Maybe this rollback behavior at the end (hibernate manager clean up) should
be switched to commit.

Here I just wrapped the session to decorate it and its forbidden outside of
a commitafter to call any of the  methods session.save/update/delete or
saveOrUpdate. I detected several problems that were new this way. Same as
always forgotten commitafter annotation.

Reply via email to