-
1. Re: How to clean or refresh EJB cache?
swjackson May 10, 2007 10:37 AM (in response to kentzhou)sounds to me like you are not calling session.flush() if you are using CMT or you are not calling commit() for BMT.
There is also this property you may want to look at
hibernate.transaction.flush_before_completion=false|true -
2. Re: How to clean or refresh EJB cache?
kentzhou May 11, 2007 2:50 PM (in response to kentzhou)Hi, Thanks for reply.
I think it is not related to Commit. I have tried your suggestion, but can't solve this issue.
The problem is: when the Entity Bean is in JBOSS pool already(this is server side cache), next time if app needs the EJB, it will get from pool, but the data in database maybe changed. So question is how to Synchronize EJB with database in the pool when app get it.
With CMP, you can use something like EntityManager.flush(), but how to do the same thing with BMP? -
3. Re: How to clean or refresh EJB cache?
swjackson May 14, 2007 12:09 PM (in response to kentzhou)You can try EntityManager.refresh().
You may also want to revisit your configuration( annotations, persistence properties).
Are you manually changing the data in the database or is your Bean updating the record? -
4. Re: How to clean or refresh EJB cache?
kentzhou May 14, 2007 3:31 PM (in response to kentzhou)
Change the data manually. same data could be changed by different apps at different time.
EntityManager come out for EJB 3.0, but my application user EJB 1.1.
Can you show me some demo code how to apply EntityManager for EJB 1.1? -
5. Re: How to clean or refresh EJB cache?
kentzhou May 14, 2007 3:40 PM (in response to kentzhou)And my JBOSS AS is jboss 3.2.7