EJB Section Index | Page 7
What is PortableRemoteObject.narrow() method and what is used for? I found somewhere that it is "CORBA compliant". Why?
Hi,
When you execute a lookup to get the home interface of your bean, you normally use the lookup() method of the javax.naming.Context interface.
This method will return you an Object that needs t...more
Does Stateful Session bean support instance pooling?
According to Richard Monson Haefel's book (Enterprise Java Beans, O'Reilly), Stateful Session Bean conceptually doesn't have instance pooling. But some container implement pooling internally.
Acc...more
Application Exception and EJB Transaction. If I throw a custom ApplicationException from a business method in Entity bean which is participating in a transaction, would the transaction be rolled back by container? Does container rolls back transaction only in case of SystemExceptions?
The short answers are: No and Yes.
A SystemException is a subtype of java.lang.RuntimeException, while an ApplicationException is any Exception that does not extends neither java.lang.RuntimeExce...more
EJB 2.0 CMP example. Where can I find an example that can help me in developing an Enterprise JavaBeans 2.0 Container-Managed Persistence?
Check out the Java Developer Connection of Sun's Java web site.
There is a very interesting article, written by Beth Stearns: Enterprise JavaBeans 2.0 Container-Managed Persistence Example.more
Static variables in EJB should not be relied upon as they may break in clusters. Why?
Referring article: http://servlet.java.sun.com/javaone/javaone2000/pdfs/TS-1295.pdf
Static variables are only ok if they are final. If they are not final, they will break the cluster.
What that m...more
Why are ejbActivate() and ejbPassivate() included for stateless session bean even though they are never required as it is a nonconversational bean?
To have a consistent interface, so that there is no different interface that you need to implement for Stateful Session Bean and Stateless Session Bean. Both Stateless and Stateful Session Bean im...more
Life Cycle of Stateful and Stateless Session Beans.
Stateful Session Bean
A stateless session bean has only two states: Does Not Exists and Method Ready Pool.
A bean has not yet instantiated (so it is not an instance in memory) when it is in the Do...more
Why an onMessage call in Message-driven bean is always a seperate transaction?
From the EJB 2.0 specification: "An onMessage call is always a separate transaction, because there is never a transaction in progress when the method is called."
When a message arrives, it is pas...more
About J2EE Application Server Scalibility Issue
Does scalibility means supporting mulitiple concurrent users alone?
Scalability means that the performance of the application does not deteriorate greatly as more users are connected to the syste...more
What are all the steps that are required to port EJB 1.1 code to EJB 2.0 compatible?
Question continues:
What are all the changes I have to do for my EJB1.1 code to port into EJB2.0 compatible. The present application is in EJB1.1. I need to port this code to EJB2.0 spec.
Ejb 1.1...more
What is the difference between Context, InitialContext and Session Context? How they are used?
javax.naming.Context is an interface that provides methods for binding a name to an object. It's much like the RMI Naming.bind() method.
javax.naming.InitialContext is a Context and provides imp...more
EJB-JNI-Legacy Integration(C++ API)
EJB-JNI-Legacy Integration(C++ API)
We have exisitng System in C++.We want to use Existing in the intranet/internet. We are using JNI to use existing System. And then we
are calling JNI Classes i...more
Can I develop an Entity Bean without implementing the create() method in the home interface?
I think you can.
As far as I know, there is nothing, in the EJB specifications, that prevents you to create an Entity Bean without the create() method. In this situation, the only way to obtain an...more
Can I write a method in CMP 2.0 Entity Bean which can retrieve some data from database (ie. is it possible to have a CMP entity bean mapped to a particular table and have a business method in it which retrieve some data from a different table)?
CMP 2.0 entity bean.
Can I write a method in CMP 2.0 Entity Bean which can retrieve some data from database (ie. is it possible to have a CMP entity bean mapped to a particular table and have a bus...more
What is the need of Remote and Home interface. Why cant it be in one?
Hi,
In a few words, I would say that the main reason is because there is a clear division of roles and responsabilities between the two interfaces.
The home interface is your way to communicate wi...more