[jboss-user] [EJB 3.0] - EJB3, JSF and Ajax: Exception when cleaning form object attr
mvpc
do-not-reply at jboss.com
Mon May 18 16:23:40 EDT 2009
Hello People!
I am having some trouble with a ajax form. After i have inserted the object on the database through ejb sessionbean and call a method to clean the jsf form by setting null the managed bean object attributes. I receive a message (Transaction Fail) from jsf PhaseListener mecanism, and the operation is undone.
My jsf form is something like this:
<h:inputText id="address" value="#{managedBean.email.address}" ></h:inputText>
Then i have a method that insert in the database through ejb sessionbean and set the email attribuetes to null, include the id.
After that i have a method that list the emails. At tgis point it throws an exception on the log, something like this:
javax.persistence.PersistenceException: org.hibernate.HibernateException: identifier of an instance of my.entity.Email was altered from 77 to null
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:76)
at my.sessionbean.EmailSessionBean.list(EmailBean.java:54)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
.
.
.
.
The interesting thing is that I can perform the operation perfectly with other form with the same template. I think is something related with EJB objects beeing used ad the attribute on the jsf form.
So if anyone have any tip, please, let me know. I have searched through out the internet and found no solution.
Thanks!!
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4231724#4231724
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4231724
More information about the jboss-user
mailing list