0 Replies Latest reply on Jun 3, 2010 6:33 AM by Manu Osten

    EntityQuery vs stateful session bean with @DataModel

    Manu Osten Apprentice

      Hello,


      My project is based on framework ejb3 and jsf1.2/richfaces3.3. There are a lot of stateless session beans and backing beans. I want to refactor my project on Seam2/EJB3/JSF/Richfaces. But I have two ways to refactor.


      1) Using generated entities from JBoss Tools to generate entity beans, two javabeans with extends of entityquery and entityhome and xhtml. Then I can build with old source code on the generated code.


      2) Moving the jsf backing beans into backend as stateful session bean and refractor it on seam framework. The stateless beans would not be refacted, because stateful beans can access over stateless beans to db.


      Question:
      Using with EnityHome and EntityQuery is very nice and comfortable, But both are not session beans. Why? That means, that have no features of ejb for example (transaction, timeout,...). I think it is no problem, if I annote @stateful or @stateless on the object with extends of EntityQuery and EntityHome. Right? Is it good way?


      Or is it better to make a new session beans with @Datamodel without extends EntityHome and EntityQuery?


      In future I want to use my project on cluster, so is it better to use session beans?


      Thank you in advance


      Manuel