This content has been marked as final.
Show 1 reply
-
1. Re: Flushing CMP 2.0 EntityBean updates before end of transa
srikap2007 Aug 25, 2007 11:10 AM (in response to reddy_123)Hi Ram,
Entity Bean is in memory, so you are seeing your updates. And JDBC is reading from database so you are not seeing your updates. EJBFind is returning reference to the bean in memory. Anyway, if you want to see the results from session bean, then you should force entity bean (its like cache/buffer) to commit. That you can do by calling entity bean method with in a transaction (thats the only way ejbStore is guaranteed to call).
Or you can implement SessionSynchronization interface in your sessionBean. Then you can listen to Beforecommit event. Thats a different approach but more right approach to achieve what you are trying to do.