Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / JavaBeans / July 2005

Tip: Looking for answers? Try searching our database.

initContext.lookup("java:comp/UserTransaction");

Thread view: 
mark - 08 Jul 2005 10:51 GMT
hi, i have read the tutorials but cant get this jndi code to work - do i
need to start a naming server or something to get a reference to the
UserTransaction class. my app locks when run but will run without this code.
i want the code in the method to be transactional. thanks,

Context initContext = new InitialContext();
UserTransaction tran = (UserTransaction)
   initContext.lookup("java:comp/UserTransaction");

tran.begin();
.......
.........
.......
tran.commit();
Volker Raum - 08 Jul 2005 13:30 GMT
> hi, i have read the tutorials but cant get this jndi code to work - do i
> need to start a naming server or something to get a reference to the
[quoted text clipped - 10 lines]
> .......
> tran.commit();

Hi mark,

your code looks great. Mine looks exactly the same.
What you definitly need are two things:
1. a JNDI Server
2. a Transactional Server

Are you wroking in an application server environment?
If not, you got a problem.

regards Volker
mark - 08 Jul 2005 16:47 GMT
hi, my app consists of a client server socket based, the code i want to make
transactional resides on the server, this code updates a vector in another
class. i do not have a specific jndi server running although does my socket
based server count as a transactional server,thanks,mark

>> hi, i have read the tutorials but cant get this jndi code to work - do i
>> need to start a naming server or something to get a reference to the
[quoted text clipped - 21 lines]
>
> regards Volker


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.