We have a Stateful Bean that loads our currentUser object (An @Entity) and 
outjects it. It is the injected to an stateless action bean that edits the 
password of the userObject. When I run this in JBoss environment the Entity 
seems to get detached from the hibernate session Context as I can alter the 
passwort, reload the Entity from the DB and no update is issued.

( need to do this because I want to compare old and new password)

Now I wrote a SeamTest to test the Action class. When I run the same code in 
the embedded Container, the Entity somehow seems to be attached to the 
Hibernate Session, as hibernate executes an update on my changed passwort 
before it reloads the Entity from the database. I hoped to have the same 
behaviour in both environments. 

Has anyone made similar experiences ? any help is appreciated as we surely want 
to Test out action classes.

Thx Thomas


  | 
  | // passwort is changed on selectedBenutzer
  | // in Jboss the old entity is reloaded from the db
  | // in SeamTest hibernate executes an update before it does the select
  | Benutzer oldbenutzer = 
benutzerDAO.findByPrimaryKey(selectedBenutzer.getId());
  | String oldpasswort = alterbenutzer.getPasswort();
  | benutzerDAO.changeBenutzer(selectedBenutzer);
  | 
  |         

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4005806#4005806

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4005806
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to