Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Resource Referencing within a thread

 
Dale Robert
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Thanks,
DRR
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!