"Lehren" wrote : Hmmm.. fair enough. Thank you, though I'm having trouble 
connecting the TreeCache to the TransactionManager. I'm quite sure it's my 
fault for not understanding it well enough.
  | 
  | There doesn't appear to be a TreeCache.setTransactionManager(..) method as 
implied by your snippet. Distilling from many examples of how to use the 
factory I get the following (code abbreviated for legibility):
  | 
  | 
  |   | String FACTORY = "org.jboss.cache.transaction.DummyContextFactory";
  |   | Properties properties = new Properties();
  |   | properties.put(Context.INITIAL_CONTEXT_FACTORY, FACTORY);
  |   | 
  |   | DummyTransactionManager transactionManager = 
DummyTransactionManager.getInstance();
  |   | 
  |   | org.jboss.cache.TreeCache tc = new org.jboss.cache.TreeCache();
  |   | PropertyConfigurator config = new PropertyConfigurator();
  |   | config.configure(tc, "Private-TreeCache.xml");
  |   | tc.start();
  |   | 
  | 
  | And the Lookup class is in the xml:
  | 
  | 
  |   | <attribute 
name="TransactionManagerLookupClass">org.jboss.cache.JBossTransactionManagerLookup</attribute>
  |   | 
  | 
  | Then during use most examples call for the something akin to the following, 
but the lookup always gives me a null.
  | 
  | 
  |   | UserTransaction tx = (UserTransaction) new 
InitialContext(properties).lookup("UserTransaction");
  |   | //UserTransaction tx = new DummyUserTransaction(transactionManager);
  |   | tx.begin();
  |   | tc.put(node, key, value);
  |   | tx.commit();
  |   | 
  | 
  | Your pseudo-code snippet implies that there is an easier way for the 
default case?
  | 
  | Thank you very much..

You should be able to simply set a TransactionManagerLookupClass in your XML 
file, which is different per TreeCache instance.

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

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


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to