[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Problem: Write data with EJB, read with Hibernate

Jörg do-not-reply at jboss.com
Thu Jul 13 08:47:20 EDT 2006


Hello,

I use EJB to update a record in a MySQL 4 database. 
After this I try to read with Hibernate, but the data is not updated yet.
After a page refresh, the new data is there.

More Details:
I use JBoss 4.0.2 and EJB 2.0 . The data comes by a http request, a portlet calls a stateless sessionbean and this calls a entitybean to update a record in the database. The entitiybean is configured as "Instance Per Transaction CMP 2.x EntityBean" . Then the entitybean is left and the sessionbean is left. (Then the data should be written into the database, I assumed). The portlet class reads the records of the updated table using hibernate. But now the record that should have been updated, still contains the old values. 
Then I try to call the data again (without any action) and now hibernate receives the updated record correctly.

Is this a kind of caching problem? How can I solve this problem?
Thanks for your reply.

Jörg


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

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3957716




More information about the jboss-user mailing list