[jboss-user] [JBoss Seam] - Database flush problem
mirko27
do-not-reply at jboss.com
Tue Jan 1 18:16:51 EST 2008
We have non-seam component entity - Client.class
We outject it to session context while logging in:
| @In(required = false, value="client")
| @Out(value = "client", required = false, scope = ScopeType.SESSION)
| private Client user;
| @In
| private EntityManager em;
| public boolean authenticate() {
| try {
| user = (Client) em.createQuery(
| "from Client where email = :username and password = :password").setParameter("username", Identity.instance().getUsername()).setParameter("password", sha1(Identity.instance().getPassword())).getSingleResult();
| }
|
The client is outjected to session scope ( seen from debug.seam)
So then we have a page with a form to change client`s data.
| <ice:form>
| <h:inputText id="firmName" styleClass="w120" value="#{client.name}"/>
| <ice:commandButton action="update" />
| </ice:form>
|
When I press the button, the data is changed inside client in session scope (debug.seam).
But this data is not flushed to database. I am using SMPC and it is extended persistence context right? Therefore all the entities retrieved from entitymanager (client is retrieved from smpc as seen in code example) should get automatically flushed. When I log out the modified data is lost and new login has old values.
Am I missing a point here?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4116278#4116278
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4116278
More information about the jboss-user
mailing list