×

Loading...

Topic

This topic has been archived. It cannot be replied.
  • 工作学习 / IT技术讨论 / EJB:Dear Jabber,in a stateful session bean's ejbCreate(String),I retrieve a record from db to intialize the attributes.Could I do this in one of the constructors instead of ejbCreate?
    I am confused with this:what should I do in ejbCreate?what in constructor?
    • The answer is no. In the EJB design, create methods play a role of CONTRUCTORs. ----This is a design pattern.
    • NO. Because you cannot start a transaction in ejbCreate. The container will be responsible for transaction only in business methods.