Home : Restrictions When Accessing COM Objects from EJBs
Q30417 - INFO: Restrictions When Accessing COM Objects from EJBs

Restrictions When Accessing COM Objects from EJBs

 

The EJB specification places several restrictions on what EJBs can and can not do. This in turn affects what J-Integra can do. Specifically when using J-Integra to access a COM component from an EJB:

1. You must use DCOM mode (Native mode can not work since native code can not be used from EJBs).

2. You must call AuthInfo.setDefault(...) or AuthInfo.setThreadDefault(...) to establish authentication credentials (you can not let J-Integra use native code to pick up the credentials of the current user, since native code can not be used from EJBs).

3. You can not subscribe to events (this requires J-Integra to establish a ServerSocket, which is not allowed in EJBs).

4. You can not pass Java objects as parameters to method calls on COM components and have the COM component make callbacks (this requires J-Integra to establish a ServerSocket, which is not allowed in EJBs).

5. In addition, the J-Integra runtime normally makes use of threads. Because the creation of threads in EJBs is not allowed, work that the J-Integra runtime would normally perform in the background does not take place. Specifically the J-Integra runtime can not perform DCOM pinging, which tells remote servers that COM components are still in use by Java clients. The effect of this is that COM components will be released automatically after six minutes.

Note:

When running in DCOM mode the J-Integra runtime sends DCOM ping messages per the DCOM protocol to tell the COM server that the client is still alive. According to the DCOM specification, DCOM clients send these ping messages every two minutes. If 3 consecutive ping intervals (six minutes) goes by without the COM server receiving a ping message, the server assumes the client has either crashed or become unreachable due to a network failure and will release and cleanup its references (MSDN Article: Lifecycle Management and Marshalling). This behavior applies to all applications that use DCOM to communicate.

EJB Accessing COM Component Example

Please read the iPlanet example in order to see how to use COM components from EJBs.

Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
No user comments available for this article.
Created on 6/23/2006.
Last Modified on 7/11/2006.
Last Modified by No Author Name Available!.
Article has been viewed 3298 times.
Rated 4 out of 10 based on 5 votes.
Print Article
Email Article