What is the difference between ejbcreate() and ejbpostcreate()




















So i dont think your create method without arguments is going to work. You have to implement ejbCreate method corresponding to the method create method in the homre interface. Did I say something different? Well, your reply was short and precise. Not allowed Well, your reply was short and precise. Not allowed He didn't add much to it either. Where must I declare this new method? If it is in the Fabrik How must I declare this method?

And I can't deploy! U should have every method in local interface which all declared in the bean class. TransactionRequiredException: EntityManager must be access within a transaction" when I call methodA, which calls methodB, whoch merges some objects to em. Why methodB didn't begin a transaction? If I put methodB in another stateless session bean, with "em" reference, it works.

What I'm trying to do in my application is to execute a business use case action methodA , but not to start transaction immediatly. I want to delay it, to a moment when methodB is called. By the way, is calling one public method from another in same statless session bean normal usage?

Should I avoid it? Thank you. I forgot about calling method through injected interface. Stupid mistake. I'm sure it will work now Can sessionBean have a business mothed that return Object? Sunil Kumar Naik Oct 28th, GG Mar 13th, Give your answer: If you think the above answer is not correct, Please select a reason and add your answer below.

Open Questions Answered. Latest News. It looks like you are using an AD Blocker! Disable Ad Blocker Learn More. Login GeekInterview Login. Create your GeekInterview account Signup. Rich ———-. Entity bean will have both ejbCreate and ejbPostCreate methods. The ejbPostCreate method returns void, and it has the same input parameters as the ejbCreate method. If we want to set a relationship field to initialize the bean instance, we should do so in the ejbPostCreate method.

The ejbPostCreate allows the bean to do any post-create processing before it begins serving client requests. For every ejbCreate there must be a matching matching arguments ejbPostCreate method.

The ejbCreate is invoked by the container prior to the bean being created, and prepares the bean for creation. The ejbPostCreate is invoked by the container directly after the bean instance is created, to perform any follow-up methods, just before the result is returned to the client.

Messenger with Voice. No Account? Sign up. By signing in, you agree to our Terms of Use and Privacy Policy.



0コメント

  • 1000 / 1000