File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

User Txn - Lookup problem

 
Shivaji Bhosale
Ranch Hand
Posts: 70
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From my simple Java Class client, I want to initiate User Txn. Server CMPs have Txn attributes as TX_REQUIRED.
Say I am carrying out 5 Txns, & say 3rd one is failed, then previous 2 must be rolled back & next Txns must be abandoned.
Since my client is not a Session Bean, I have code like this, for having UserTransaction.
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY, factory);
ht.put(Context.PROVIDER_URL, url);
InitialContext ctx = new InitialContext(ht);
javax.transaction.UserTransaction userTrans =
(javax.transaction.UserTransaction)ctx.lookup("javax.transaction.UserTransaction");
But at this lookup I get an error NoSuchNameFoundException.
Right now I am doing this all in IBM VAJ which is having Websphere Test Environment. I have Name Server & Bean Servers running.
What is the problem? If URL is wrong ?
Waiting eagerly for replies...
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JNDI name isn't right. Lookup "jta/usertransaction" instead.

Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic