[Design of JCA on JBoss] - Mock JMS Provider
by weston.price@jboss.com
I am nearing completion on the first 'rough' pass of a MockJMS framework that allows exercising the JMS/JCA adapter outside of the application server. The fundamentals are working and I can send messages, test DLQ handling and simulate provider failures without having to deploy anything to the application server. While this is not end to end testing, I believe it does provide a decent framework for excercising the fundamental purposes of the inflow adapter:
Provider connectivity
SeverSession/Pool management
before/onMessage/after delivery semantics
Correct tranasaction enlistment based on transacted/non-transacted delivery
While most of the code is stubbed out, the necessary functions to get a basic working model are implemented. The trickiest part was extending JmsActivation and the DLQQueueHandler to override looking up the administrative objects from a real JNDI tree rather than simple instantiation.
This is not a mechanism to test JMS provider functionality. We have that pretty well covered in the rest of the testsuite.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3986793#3986793
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3986793
19 years, 4 months
[Design of JBossCache] - Can region be inheritant?
by ben.wang@jboss.com
Brian discover this during the pre-2.0Alpha integration for the http field replication with marshalling and buddy replication.
Basically, there is a slight mismatch for the concept of region between marshalling and br. In the example of field replication, when a user deploys a web app, the marshalling region is associated with the web app level, e.g., in fqn term, "/JSession/myWebApp". And then when BR is involved, the region concept is actually associated with the particular session, e.g., "/JSession/myWebApp/12345jx".
So what is the problem in PojoCache? When a user do an attach, I will look for the corresponding region first and then store the internal data under that region. For example, the fqn can be "/JSession/myWebApp/12345jx/ATTRIBUTE/joe". So when I pass this to the RegionManager to retrieve the corresponding region, I am getting "/JSession/myWebApp". But instead, I need to have "/JSession/myWebApp/12345jx".
What is the solution? Brian and I propose that he can create arbitrary region during session creation, say, "/JSession/myWebApp/12345jx". But this region has empty eviction and marshalling property. Instead, it will inherit from the parent region property. In this way, eviction and marshalling can go on without problem. While BR in PojoCache can also retrieve the correct region.
Of course, when a session is removed, the corresponding region will need to be removed as well.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3986781#3986781
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3986781
19 years, 4 months
[Design of the JBoss EJB Container] - Problem with order of entity cache operations with Hibernate
by bstansberry@jboss.com
There appears to be a difference in behavior between JBossTM and JBossTS that's leading to failures with JBoss Cache as the 2nd level entity cache.
JBC handles replication of transaction-scoped cache changes by registering as a transaction Synchronization and replicating the changes during the beforeCompletion() callback. This is failing with JBossTS because the beforeCompletion() callback is being executed *before* the Hibernate flush activity that updates the cache. No activity at time of beforeCompletion() == no replication of the tx's changes.
2006-11-16 23:48:41,250 TRACE [org.jboss.cache.interceptors.TxInterceptor] Running beforeCompletion on gtx GlobalTransaction:<192.168.1.164:2668>:1
2006-11-16 23:48:41,250 TRACE [org.jboss.cache.interceptors.TxInterceptor] Setting up transactional context.
2006-11-16 23:48:41,250 TRACE [org.jboss.cache.interceptors.TxInterceptor] Setting tx as TransactionImple < ac, BasicAction: -3f57ff9b:a5b:455d4cd6:10 status: 0 > and gtx as GlobalTransaction:<192.168.1.164:2668>:1
2006-11-16 23:48:41,250 TRACE [org.jboss.cache.interceptors.TxInterceptor] No modifications in this tx. Skipping beforeCompletion()
2006-11-16 23:48:41,250 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] processing flush-time cascades
2006-11-16 23:48:41,250 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] dirty checking collections
2006-11-16 23:48:41,265 DEBUG [org.hibernate.engine.Collections] Collection found: [org.jboss.ejb3.test.clusteredentity.Customer.contacts#1], was: [] (initialized)
2006-11-16 23:48:41,265 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Flushed: 3 insertions, 0 updates, 0 deletions to 3 objects
2006-11-16 23:48:41,265 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Flushed: 1 (re)creations, 0 updates, 0 removals to 1 collections
...
followed by puts into the cache
When I switched the AS back to using JBossTM, the problem went away -- the Hibernate flush activity occurred first, and then the beforeCompletion() call to JBC.
I'm speculating that Hibernate is also using a Synchronization to manage the flush, and that JBossTA and JBossTS make the calls to registered Synchronizations in a different order.
At this point, replication of clustered EJB3 entities is basically broken.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3986745#3986745
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3986745
19 years, 4 months
[Design of JBossCache] - Re: TreeCacheProxyImpl.getChildren() ugliness
by genman
Okay, not to crap on everyone... So that method (List.size()) was 20% of the runtime for whatever reason.
As an experiment, I changed getChildren() to getChildrenMap() in NodeImpl, so I could mix in NodeSPI. Then I fixed up a few classes here and there. Life seemed good. This method seemed fixable...
But then... I reran the tests, but they failed. Oops! I fixed some casts in the LockingInterceptor. Tests hang. Curious, I searched for any additional dependencies on TreeCacheProxyImpl. Eclipse found like 93 references (many casts) to TreeCacheProxyImpl. All those would have to be changed for me to go futher...
My immediate reaction was: Fuck. 90 places in the code now depends directly on this class, I don't know how many are casts.
The only refactoring that makes sense is to fix existing node classes, retrofit TreeCache with CacheSPI and get rid of this shit. There's just no way I'd run 2.0 seeing what's in the sausage now.
And I don't see the value of the new API if it's just a ugly retrofit with worse performance. "-1" as they say...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3986743#3986743
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3986743
19 years, 4 months