jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SY-1 <tyler2002...@yahoo.fr>
Subject Transaction over RMI?
Date Fri, 04 Jul 2008 14:26:20 GMT

Hi all!

I would like to know if transaction works over RMI?  there is my code :

Hashtable ht=new Hashtable();
ht.put("java.naming.factory.initial",
"org.jboss.naming.NamingContextFactory");       
ht.put("java.naming.provider.url",  "jnp://localhost:1099/jcrServer");
ht.put("java.naming.factory.url.pkgs",
"org.jboss.naming:org.jnp.interfaces");
InitialContext initialContext = new InitialContext(ht);

ClientAdapterFactory adapter = new ClientAdapterFactory();
RemoteRepository rr=(RemoteRepository)
initialContext.lookup("jnp://localhost:1099/jcrServer");
Repository repository = adapter.getRepository(rr);
Credentials credJBoss = new
SimpleCredentials("username","password".toCharArray());
Session s=repository.login(credJBoss); 
Node root = s.getRootNode();

UserTransaction utx = (javax.transaction.UserTransaction)
initialContext.lookup("java:UserTransaction"); utx.begin();
root.addNode("M5");
s.save();
utx.rollback();
s.logout();

The problem is that neither commit or rollback works ? so i m wondering if
RMI support transaction operation? if anyone has an idea it would be great
thanks !


-- 
View this message in context: http://www.nabble.com/Transaction-over-RMI--tp18280046p18280046.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Mime
View raw message