Hey,

> Hi,
> 
> We have the following problem :
> 
> The problem is that we have to deal with direct access to the 
> underlying
> database. We absolutely cannot make all accesses go through the EJB
> layer (for now that is). While this is the case, we have to 
> find ways to
> make JBoss refresh the data from the physical database when it is
> changed.
> 
> So we thought it would be simple to add a SSB to offer cache 
> management
> services to our "old" application to call. ie. make changes through
> VB/ADO/OleDB application and "inform" the JBoss server that 
> those tables
> need to be "flushed".
> 
> But we do want to keep the cache, because it is more efficient.
> 
> So we created our own LRUEnterpriseContextCachePolicy class to be able
> to passivate beans with JMS messages.  We actually call the ageOut
> method with the beans key we want to flush by going through 
> the LRUList
> obtains from getList() method. But there is still a problem, the beans
> that are in a transaction don't get passivated.
> 
> How can we ensure that all the beans we want to be passivate get
> passivated and  that, wathever is the age of the bean ?

Well, you coded the new cache, so you can enforce that also bean with an
active tx will be passivated, even if I would not recommend it, since it
could lead to problems when the tx will be committed.

Anyway, what you really need is not a passivation IMHO, but a complete
reload of the beans that are in the cache from the underlying DB. Normally
you can do this using commit options B or C, but you still want to have A
and only sometimes (upon JMS message) a behavior like B or C.
IMHO best solution will be mark all the cached beans for reload, instead of
passivating them, and this can be done by a custom TimerTask simply
extending LRUEnterpriseContextCachePolicy with your cache.
Check the EntitySynchronizationInterceptor for informations about the flag
that marks a bean for reload.

HTH,

Simon

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to