• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

User Txn - Lookup problem

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You firghten me terribly. I would like to go home now. Here, take this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic