This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi, The reason you thought for static is correct. The reason it should be void is as follows : The ejbCreate() metod returns void in EJB1.0 and a null value for the bean's primary key in EJB1.1. The end result is same in ejb1.0 and ejb1.1, the return value of the ejbCreate() method for a Container managed bean is ignored. Ejb1.1 changed its return value from void to the primarykey type to facilitate subclassing; the change was made so that its easier for a bean-managed bean to extend a container managed bean. In ejb1.0 this was not possible because java won't allow you to overload methods with different return values. By changing this definition so that a bean managed bean can extend a container managed bean, the new specification allows vendors to support container managed persistence by extending the container-managed bean with a generated bean-managed bean- a fairly simple solution to difficult problem. Bean developers can also take advantage of inheritance to change an existing CMP bean into a BMP bean, which may be needed to overcome difficult persistence problems. I think u understand this well. Bye. Loke.