Hi Anup,

        Using option 1 or 2  may involve some security problems depending on
the app server. Strictly speaking EJB spec prohibits from loading any native
library using EJBs. (section 23.1.2 Programming restrictions).

I guess CORBA should be a better option. The enterprise java bean can use
CORBA APIs to delegate calls to your native code and also propagate the
transaction contexts.

Messaging service can be an option if you are looking for asynchronous
communication.

regards
Prince



-----Original Message-----
From: Anup Maliyackel [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 28, 2001 12:07 AM
To: [EMAIL PROTECTED]
Subject: Jni and EJB


I have a design issue regarding JNI and EJB. I have a native library with
me for predictive modelling. I want to use the library along with EJB. I
have searched the archives and a few other sites like theserverside.com and
have got a few tips

1. Even though J2EE prohibits JNI from EJB a lot of app servers allow you
to do it. So one option is use JNI directly from EJB.
2. Use a helper class having a static block to load the library. This
helper class can have methods(static?) to call the native methods. From EJB
call the methods of the helper class
3. Use RMI from EJB to talk to the native library
4. Use CORBA
5. Use messaging service

My questions are

1. Are there any security issues in using option 1 or option 2?
2. What should be the approach if the native library has to maintain state
and might be part of an ejb transaction?
3. Are there any problems with concurrent access to the library?
4. What about exceptions thrown from native code? How will it affect
clustering, transactions etc.
5. What are the pros and cons of the various approaches listed above.

Any tips would be appreciated
Regards
Anup

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
This e-mail and any files transmitted with it are for the sole use
of the intended recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply e-mail and
destroy all copies of the original message. Any unauthorised review, use, disclosure,
dissemination, forwarding, printing or copying of this email or any action taken in
reliance on this e-mail is strictly prohibited and may be unlawful...

                Visit us at http://www.cognizant.com

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to