vivek kumar

Greenhorn
+ Follow
since Sep 18, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by vivek kumar

Hi,
I came across this question:-
Which of the following transaction attributes assigned to a business method willcause the container to throw java.lang.IllegalStateException when
the method calls EJBContext.getRollbackOnly?
a. Mandatory
b. Never
c. NotSupported
d. Required
e. RequiresNew
F. Supports

Answer: B, C, F
A method with Never, NotSupported, or Supports usually runs in an unspecified context.

I am not able to understand why Supports always run in unspecified context.
If the method is called from a transaction then this method should run under that transaction and there will not be any java.lang.IllegalStateException. Any help?
Hi,

while running a build i got following error

Any idea about this error?
16 years ago
Hi,

while running a build i got following error

Any idea about this error?
16 years ago
Yes! entity bean can be used to update,insert and delete.
Suppose you have an entity bean Employee.
Insert:- When we call EmployeeHome.create("xyz",123) a new row is inserted in Employee table.
Update:- When we call Employee.setName("abc") the name will be updated to abc.
Delete:- when we call Employee.delete

We can session bean for database related operations, create a connection pass SQL string (Like normar JDBC) but its not an standard practice.
Hi Deepak,
Let me explain you. We have two entity on severe EJBObject and Actual Bean. Client can never access actual mean instance,it will always invoke method on EJBObject instance.When we call create method, an instance of EJBObject is creates and is returned to client. But this EJBObject is not attached to any Bean instance. When we call a business method then the container pull a bean insatce from pool and attach this bean instance with the returned EJBObject and call the business method.
- Client call goes to EJBObject
- Container pull a bean instacne and attach it to the EJBObject on which client has called a business method.
- then this EJBObject instace delegate this methos to bean instance
These are not compatible:-
The hierarchy is like Room->ClassRoom->Lab
Rule is, super class array reference can hold the subclass array type but not the reverse.
So rooms = crooms; is correct but not labs = crooms;
These are not compatible:-
The hierarchy is like Room->ClassRoom->Lab
Rule is, super class array reference can hold the subclass array type but not the reverse.
So rooms = crooms; is correct but not labs = crooms;
Can we have been look up like :-
InitialContext ictx = new InitialContext();
Context myenv = ictx.lookup("java:comp/env");
SS1Home home = (SS1Home)javax.rmi.PortableRemoteObject.narrow(myEnv.lookup("ejb/ses1"),SS1Home.class);
from a Helper class?

Say there is a bean that call a helper class, then can this helper class lookup a bean as mentioned above or we can have look up only in bean?
Well, U mean to say that the flow will not procees till we successfully run create() method( or say some exception).
I am not sure about it, what some of my friends told me is like this..
"When we call create method on home interface container will create an EJBObject and return the referecce of this EJBObject. Now when we call a business method on this EJBObject reference,then the actual bean will be create(If it is not in the pool)"
Accordint to one book:-
"The create() method is invoked by the client to get a reference
to the component interface of a session bean. It does not necessarily mean that a bean instance will be created upon receiving this call. If the bean is a stateless session bean, the container may already have created some bean instances and may use one of those instances to service the method calls. Or the container may wait until the client invokes a business method before it creates a bean instance."
My question is, if a bean instance is created when business method is called then what will be the value of remote component interface between create and before the business method is called. Will it be null?
Accordint to one book:-
"The create() method is invoked by the client to get a reference
to the component interface of a session bean. It does not necessarily mean that a bean instance will be created upon receiving this call. If the bean is a stateless session bean, the container may already have created some bean instances and may use one of those instances to service the method calls. Or the container may wait until the client invokes a business method before it creates a bean instance."
My question is, if a bean instance is created when business method is called then what will be the value of remote component interface between create and before the business method is called. Will it be null?