File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Resource Referencing within a thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Resource Referencing within a thread" Watch "Resource Referencing within a thread" New topic

Resource Referencing within a thread

Dale Robert

Joined: Jul 03, 2003
Posts: 1
I am using resource referencing and have it working. I access my datasource using "hava:comp/env/dataSource" I can read and write to my database.
However, my program spawns a thread and in that thread I must update a row on the same database table. Within the thread, I cannot access the database. I get a NameNotFoundException. I believe that the namespace(comp/env) cannot be seen, so that the database name is unknown.
Has anyone seen this problem before? Did I miss something when I set this up? How do you get access to the namespace within the thread? Any help would be appreciated.

I agree. Here's the link:
subject: Resource Referencing within a thread
It's not a secret anymore!