Hi Peter,

I'm not claiming guru-hood, but as far as I know you CAN'T do that cleanly.
 My thoughts on your best options are:

1) Tell Orion that the entity beans do not have exclusive write-access to
the database by setting exclusive-write-access="false" in the
orion-ejb-jar.xml (which is orion-specific).  I believe this causes the
data to be re-read at the start of every transaction.

2) Re-write your session bean to makes its database changes through the
entity beans rather than through direct JDBC.

Nick

At 12:02 PM 10/12/00 +0100, you wrote:
>Hi gurus
>
>How do I do this cleanly.
>
>I have and Entity that has attributes A,B,C and D. These attributes are all
>read from database tables.
>
>A and B are read from Table 1
>C and D are read from Table 2
>
>So I have Entity Bean 1, this is loaded by the app server (perhaps by a
>findByPrimaryKey) method. This means that Entity Bean 1 is now a cache of
>the data in A,B,C and D. 
>
>However while this entity bean is in the cache, via a session bean I change
>the data of C and D in table 2. This mean that Entity Bean 1 now has dirty
>data. So the question is how do I force the Entity beans to do and EJB Load.
>
>
>Also the data in C and D in table 2 may be shared by N number of entity
>beans so I may need to refresh N number of Entity Beans depending on which
>ones are in the cache.
>
>I only want to call EJB load for Entity beans currently in the cache and of
>these I only want to call ejb load for the ones that refer to the changed
>data.
>
>Cheers Peter


Reply via email to