This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
So I now have an entity bean adaptor that will access the high counter entity bean. I've made a static final HighCounterHome object. So this will be used by all ejbCreate methods requiring a new, unique ID. Will there be any problem in holding on to this home object for, say, weeks at a time? Will there be any problem in having this one home object be used by, say, hundreds of different entity beans?
I would take a look at serializing the bean into a handle. Something like: Context ctx = new InitialContext(); Object obj = ctx.lookup("com.session.ProductHome"); ProductHome home = (ProductHome) PortableRemoteObject.narrow(obj,ProductHome.class); product = home.create(); session.setAttribute("handle", product.getHandle()); handle = (Handle) session.getAttribute("handle"); product = (Product) handle.getEJBObject();