[JBoss Seam] - SeamTest Entity Life Cycle strange behaviour
by eiswind
We have a Stateful Bean that loads our currentUser object (An @Entity) and outjects it. It is then 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. In a first request I assure the Stateful Bean is instantiated, in a second request i actually test the action bean. I tried to use two requests but it doesnt help. When I run the 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 currentUser
| // in Jboss the old entity is reloaded from the db
| // in SeamTest hibernate executes an update before it does the select
| Benutzer oldUser = benutzerDAO.findByPrimaryKey(currentUser.getId());
| String oldpasswort = oldbenutzer.getPasswort();
| benutzerDAO.changeBenutzer(currentBenutzer, newPasswd);
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4005809#4005809
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4005809
19 years, 3 months
[JBossWS] - Wrong incomming SOAP not intercepted
by bossy
Could someone please tell me does JBoss enforce the restrictions put in the wsdl and how?
I have WS that runs under JBoss. In my wsdl I put a restriction on one of the elements to make sure that it's always present in the request:
<element name='mailbox' nillable='false' minOccurs="1" maxOccurs="1" type='string' />
I was expecting that in the unlikely event this element is missing from the request, this will be intercepted and an appropriate SOAP exception will be thrown, without me having to do anything.
The debug shows, though, that that's not the case.
The request is accepted and sent for processing, which of course fails, as there's missing information.
Do I need to do additional validation or am I right to think that JBoss should enforce the restrictions itself?
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4005807#4005807
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4005807
19 years, 3 months
[JBoss Seam] - SeamTest Entity Life Cycle
by eiswind
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
19 years, 3 months