|
From: Leif M. <le...@ta...> - 2003-11-06 03:35:33
|
Philip, That is strange. I can't think of any reason why a new thread would be spawned when running under the Wrapper but not when run standalone. If the JNI is spawning a new thread then it must be something that the native code is going out of its way to do. There is nothing in the JNI call itself that would do this. Are you absolutely certain that there is nothing in your java application which is starting a new java thread that is in turn calling into JNI? If a thread is being spawned inside of the native call, then the original thread should be returning to the JVM context? Is it possible to confirm that this is happening? Cheers, Leif Philip Kubat wrote: > Ok, here is my guess on what is going on. DCOM/COM interfaces exists > in a MTA (multi thread apartment) and maintains is own reference > counter to threads using it, as stated my Microsoft. When I the java > app in ran within wrapper the jni calls are started in new threads. I > can view this via the Microsoft debugger. When the first call finishes > that thread ends, (prior to me next jni call) and it kills the last > and only reference in the MTA. Thus when the other JNI calls go to use > this interface it now longer exists. > > So the question is why do the jni calls get place in new threads. This > is not the results when the app is not ran within wrapper. IE “java > myAppClass” > > Thanks > > Phil > |