|
I have a server daemon program written in Java that does the following: - Monitor a data queue waiting for a request to come in - When a request is read, spawn a worker thread to do the work and go back to monitoring the queue - The worker thread uses ProfileTokenCredential to swap to a different user profile to do some work on behalf of that user and then swaps back and finishes. According to the javadoc for ProfileTokenCredential: "When referenced from a running process on the associated iSeries system, a profile token can be used to modify or swap the OS/400 thread identity and perform a specific task or tasks on behalf of the authenticated user." The problem is when one worker thread swaps user profiles it seems to swap the thread identity of the ENTIRE JVM and not just that one worker thread. This causes the other worker threads to be working on behalf of the wrong user, and all sorts of problems ensue. The main thread that is monitoring the data queue cannot read entries from it anymore without throwing "Password is not set" errors, the worker threads My question is ... are native threads supported by the iseries JVM? My thoughts are that if there is a native thread backing each of the worker threads then maybe .. just maybe .. ProfileTokenCredential will only change that thread's os400 identity and not the others. Anyone have any ideas on this one? Note - executing the following command from QSH does not work. It just prints a help message and fails: java -native HelloWorld Thanks, Phil Denis
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.