[jboss-dev-forums] [Design of EJB 3.0] - Bringing in ejb3-cache

ALRubinger do-not-reply at jboss.com
Thu Oct 30 03:08:12 EDT 2008


Recent work in SimpleStatefulCache has uncovered a few issues:

* https://jira.jboss.org/jira/browse/EJBTHREE-1551
* https://jira.jboss.org/jira/browse/EJBTHREE-1549 (Resolved)

My tests for 1549 are imperfect as they put Thread.sleep() into the client, resulting in:

* Long execution time
* Assumption that background work will have completed in the time allotted

This has to be fixed.

The best way to do this would be to extract out portions of SimpleStatefulCache such that they may be overridden with some locking introduced (@see org.jboss.ejb3.core.test.ejbthree1549.ForcePassivationCache.BlockingPassivationTask.block()).

And while we're at it, the cache impls should really conform to the Cache SPI as dictated by the ejb3-cache project.  Currently they do not.

I'm working on the following:

* Move / Copy / Something to put SimpleStatefulCache into ejb3-cache.  Currently I can't have this implementation conform to both the legacy StatefulCache and new Cache SPIs because they're incompatible.

* Do the extraction and fix the tests as outlined above

* Add new internal callback mechanisms for things like "prePassivate", "passivationStarted", "passivationCompleted".  Part of the contract of the cache impl will be to implement these callbacks (thus allowing us to do whatever blocking/locking or get notification in tests).

* Move StatefulContainer to the new Cache SPI

* WTF was I thinking with this horrid CacheFactory-per-impl design?  Should better be a configurable factory capable of creating any N Caches.  Ditto for the PersistenceManagerFactories.  I'll have to change up the relevant jboss-beans.xml to fix this as well.

Anything else we want to get in there?  

I'm unsure of what to do with the TreeCache impl here, because the second I move StatefulContainer to rely upon the new Cache SPI, that'll break.

For now I'm starting with the elements that won't break everything.  I'll have to coordinate/schedule API changes w/ Brian.

S,
ALR

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

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



More information about the jboss-dev-forums mailing list