EJB 3.0 + JSF 1.2 architecture question

Hi,
I have some experience with EJB 2.x and now we are working on another project with EJB 3.0 + JSF. In our old project, we created an EJB facade in the JSF (as an app. bean) so every call to the backend originated from the JSF went through this facade. We had everything contained in one app. bean.
But now, with the injection and annotations, how should we approach this? Should we contain all calls to the backend in one JSF bean or this is not neccessary anymore? Our next application will run in clustered env., back end and front end on different servers (both have two nodes), so we must call the EJBs from the session scope (at least I think so). How fast and resource consuming is the injection? We are speaking about thousands maybe tens of thousands users a day.
Thanks for any advanced EJB hints.

A typical setup is to use multiple EJBs each tailored for specific tasks. For example, you could create DAO EJBs and then put one or more service EJBs in front of them that does the calls to the DAOs and manages the transactions (basically performs the business logic). From your JSF managed beans you do calls to the service bean(s) only.
As for injection and resource consumption: I wouldn't worry about such matters. The injection is at the core of EJB3 and therefore you should use it freely. Most bookkeeping is done at server startup anyway, the runtime impact should be neglectable. It makes no difference how many users your site has per day, it is the hardware that should be tailored to the demands.

Similar Messages

  • Oracle VM Server for SPARC - network multipathing architecture question

    This is a general architecture question about how to best setup network multipathing
    I am reading the "Oracle VM Server for SPARC 2.2 Administration Guide" but I can't find what I am looking for.
    From reading the document is appears it is possible to:
    (a) Configure IPMP in the Service Domain (pg. 155)
    - This protects against link level failure but won't protect against the failure of an entire Service LDOM?
    (b) Configure IPMP in the Guest Domain (pg. 154)
    - This will protect against Service LDOM failure but moves the complexity to the Guest Domain
    - This means the there are two (2) VNICs in the guest though?
    In AIX, "Shared Ethernet Adapter (SEA) Failover" it presents a single NIC to the guest but can tolerate failure of a single VIOS (~Service LDOM) as well as link level failure in each VIO Server.
    https://www.ibm.com/developerworks/mydeveloperworks/blogs/aixpert/entry/shared_ethernet_adapter_sea_failover_with_load_balancing198?lang=en
    Is there not a way to do something similar in Oracle VM Server for SPARC that provides the following:
    (1) Two (2) Service Domains
    (2) Network Redundancy within the Service Domain
    (3) Service Domain Redundancy
    (4) Simplify the Guest Domain (ie single virtual NIC) with no IPMP in the Guest
    Virtual Disk Multipathing appears to work as one would expect (at least according the the documentation, pg. 120). I don't need to setup mpxio in the guest. So I'm not sure why I would need to setup IPMP in the guest.
    Edited by: 905243 on Aug 23, 2012 1:27 PM

    Hi,
    there's link-based and probe-based IPMP. We use link-based IPMP (in the primary domain and in the guest LDOMs).
    For the guest LDOMs you have to set the phys-state linkprop on the vnets if you want to use link-based IPMP:
    ldm set-vnet linkprop=phys-state vnetX ldom-name
    If you want to use IPMP with vsw interfaces in the primary domain, you have to set the phys-state linkprop in the vswitch:
    ldm set-vswitch linkprop=phys-state net-dev=<phys_iface_e.g._igb0> <vswitch-name>
    Bye,
    Alexander.

  • Architecture question, global VDI deployment

    I have an architecture question regarding the use of VDI in a global organization.
    We have a pilot VDI Core w/remote mysql setup with 2 hypervisor hosts. We want to bring up 2 more Hypervisor hosts (and VDI Secondaries) in another geographic location, where the local employees would need to connect desktops hosted from their physical location. What we don't want is to need to manage multiple VDI Cores. Ideally we would manage the entire VDI implementation from one pane of glass, having multiple Desktop Provider groups to represent the geographical locations.
    Is it possible to just setup VDI Additional Secondaries in the remote locations? What are the pros and cons of that?
    Thanks

    Yes, simply bind individual interfaces for each domain on your web server,
    one for each.
    Ensure the appropriate web servers are listening on the appropriate
    interfaces and it will work fine.
    "Paul S." <[email protected]> wrote in message
    news:407c68a1$[email protected]..
    >
    Hi,
    We want to host several applications which will be accessed as:
    www.oursite.com/app1 www.oursite.com/app2 (all using port 80 or 443)
    Is it possible to have a separate Weblogic domain for each application,all listening
    to ports 80 and 443?
    Thanks,
    Paul

  • Running MII on a Wintel virtual environment + hybrid architecture questions

    Hi, I have two MII Technical Architecture questions (MII 12.0.4).
    Question1:  Does anyone know of MII limitations around running production MII in a Wintel virtualized environment (under VMware)?
    Question 2: We're currently running MII centrally on Wintel but considering to move it to Solaris.  Our current plan is to run centrally but in the future we may want to install local instances local instances of MII in some of our plants which require more horsepower.  While we have a preference for Solaris UNIX based technologies in our main data center where our central MII instance will run, in our plants the preference seems to be for Wintel technologies.  Does anybody know of any caveats, watch outs or else around running MII in a hybrid architecture with a Solarix Unix based head of the hybrid architecture and the legs being run on Wintel?
    Thanks for your help
    Michel

    This is a great source for the ins/outs of SAP Virtualization:  https://www.sdn.sap.com/irj/sdn/virtualization

  • @EJB annotation in JSF managed beans not working

    Hi all,
    I've been trying to get the @EJB annotation to work in a JSF manged bean without success.
    The EJB interface is extremely simple:
    package model;
    import javax.ejb.Local;
    @Local
    public interface myEJBLocal {
    String getHelloWorld();
    void setHelloWorld(String helloWorld);
    and the bean code is simply:
    package model;
    import javax.ejb.Stateless;
    @Stateless
    public class myEJBBean implements myEJBLocal {
    public String helloWorld;
    public myEJBBean() {
    setHelloWorld("Hello World from myEJBBean!");
    public String getHelloWorld() {
    return helloWorld;
    public void setHelloWorld(String helloWorld) {
    this.helloWorld = helloWorld;
    When I try to use the above EJB in a managed bean, I only get a NullPointerException when oc4j tries to instantiate my managed bean. The managed bean looks like:
    package view.backing;
    import javax.ejb.EJB;
    import model.myEJBLocal;
    import model.myEJBBean;
    public class Hello {
    @EJB
    private static myEJBLocal myBean;
    private String helloWorld;
    private String helloWorldFromBean;
    public Hello() {
    helloWorld = "Hello from view.backing.Hello!";
    helloWorldFromBean = myBean.getHelloWorld();
    public String getHelloWorld() {
    return helloWorld;
    public void setHelloWorld(String helloWorld) {
    this.helloWorld = helloWorld;
    public String getHelloWorldFromBean() {
    return helloWorldFromBean;
    Am I missing something fundamentally here? Aren't you supposed to be able to use an EJB from a JSF managed bean?
    Thanks,
    Erik

    Well, the more I research this issue, the more confused I get. There have been a couple of threads discussing this already, and in this one Debu Panda states that:
    "Support of injection in JSF managed bean is part of JSF 1.1 and OC4J 10.1.3.1 does not support JSF 1.1"
    10.1.3.1 Looking up a session EJB with DI from the Web tier
    But if you look in the release notes for Oracle Application Server 10g R3, it is explicitly stated that JSF 1.1. is supported. So I'm not sure what to believe.
    I've also tried changing the version in web.xml as described here:
    http://forums.java.net/jive/thread.jspa?threadID=2117
    but that didn't help either.
    I've filed a SR on Metalink for this, but haven't got any response yet.
    Regards,
    Erik

  • Architectural question

    Little architectural question: why is all the stuff that is needed to render a page put into the constructor of a backing bean? Why is there no beforeRender method, analogous to the afterRenderResponse method? That method can then be called if and only if a page has to be rendered. It seems to me that an awful lot of resources are waisted this way.
    Reason I bring up this question is that I have to do a query in the constructor in a page backing bean. Every time the backing bean is created the query is executed, including when the page will not be rendered in the browser...

    Little architectural question: why is all the stuff
    that is needed to render a page put into the
    constructor of a backing bean? Why is there no
    beforeRender method, analogous to the
    afterRenderResponse method? That method
    can then be called if and only if a page has to be
    rendered. It seems to me that an awful lot of
    resources are waisted this way.There actually is such a method ... if you look at the FacesBean base class, there is a beforeRenderResponse() method that is called before the corresponding page is actually rendered.
    >
    Reason I bring up this question is that I have to do
    a query in the constructor in a page backing bean.
    Every time the backing bean is created the query is
    executed, including when the page will not be
    rendered in the browser...This is definitely a valid concern. In Creator releases prior to Update 6 of the Reef release, however, there were use cases when the beforeRenderResponse method would not actually get called (the most important one being when you navigated to a new page, which is a VERY common use case :-).
    If you are using Update 6 or later, as a side effect of other bug fixes that were included, the beforeRenderResponse method is reliably called every time, so you can put your pre-rendering logic in this method instead of in the constructor. However, there is still a wrinkle to be aware of -- if you navigate from one page to another, the beforeRenderResponse of both the "from" and "to" pages will be executed. You will need to add some conditional logic to ensure that you only perform your setup work if this is the page that is actually going to be rendered (hint: call FacesContext.getCurrentInstance().getViewRoot().getViewId() to get the context relative path to the page that will actually be displayed).
    One might argue, of course, that this is the sort of detail that an application should not need to worry about, and one would be absolutely correct. This usability issue will be dealt with in an upcoming Creator release.
    Craig McClanahan

  • BPEL/ESB - Architecture question

    Folks,
    I would like to ask a simple architecture question;
    We have to invoke a partner web services which are rpc/encoded from SOA suite 10.1.3.3. Here the role of SOA suite is simply to facilitate communication between an internal application and partner services. As a result SOA suite doesn't have any processing logic. The flow is simply:
    1) Internal application invokes SOA suite service (wrapper around partner service) and result is processed.
    2) SOA suite translates the incoming message and communicates with partner service and returns response to internal application.
    Please note that at this point there is no plan to move all processing logic from internal application to SOA suite. Based on the above details I would like get some recommedation on what technology/solution from SOA suite is more efficient to facilate this communication.
    Thanks in advance,
    Ranjith

    You can go through the design pattern called Channel Adapter.
    Here is how you should design - Processing logic remains in the application.. however, you have to design and build a channel adapter as a BPEL process. The channel adapter does the transformation of your input into the web services specific format and invoke the endpoint. You need this channel adapter if your internal application doesn't have the capability to make webservice calls.
    Hope this helps.

  • Architecture Question...brain teasing !

    Hi,
    I have a architecture question in grid control. So far Oracle Support hasnt been able to figure out.
    I have two management servers M1 and M2.
    two VIP's(Virtual IP's) V1 and V2
    two Agents A1 and A2
    the scenerio
    M1 ----> M2
    | |
    V1 V2
    | |
    A1 A2
    Repository at M1 is configured as Primary and sends archive logs to M2. On the failover, I have it setup to make M2 as primary repository and all works well !
    Under normal conditions, A1 talks to M1 thru V1 and A2 talks to M2 thru V2. No problem so far !
    If M1 dies, and V1 forwards A1 to M2 or
    if M2 dies, V2 forwards A2 to M1
    How woudl this work.
    I think (havent tried it yet) but what if i configure the oms'es with same username and registration passwords and copy all the wallets from M1 to M2
    and A1 to A2 and just change V1 to V2. Would this work ????
    please advice!!

    SLB is not an option for us here !
    Can we just repoint all A1 to M2 using DNS CNAME change ??

  • Inheritance architecture question

    Hello,
    I've an architecture question.
    We have different types of users in our system, normal users, company "users", and some others.
    In theory they all extend the normal user. But I've read alot about performance issues using join based inheritance mapping.
    How would you suggest to design this?
    Expected are around 15k normal users, a few hundred company users, and even a few hundred of each other user type.
    Inheritance mapping? Which type?
    No inheritance and append all attributes to one class (and leave these not used by the user-type null)?
    Other ways?
    thanks
    Dirk

    sorry dude, but there is only one way you are going to answer your question: research it. And that means try it out. Create a simple prototype setup where you have your inheritance structure and generate 15k of user data in it - then see what the performance is like with some simple test cases. Your prototype could be promoted to be the basis of the end product if the results or satisfying. If you know what you are doing this should only be a couple of hours of work - very much worth your time because it is going to potentially save you many refactoring hours later on.
    You may also want to experiment with different persistence providers by the way (Hibernate, Toplink, Eclipselink, etc.) - each have their own way to implement the same spec, it may well be that one is more optimal than the other for your specific problem domain.
    Remember: you are looking for a solution where the performance is acceptable - don't waste your time trying to find the solution that has the BEST performance.

  • General Architecture question - EJB

    I am working on defining an architecture to use for an application that will be providing maintenance for database tables (inserts/updates/deletes). My desires are to have the application distributed using Java Web Start.
    I am struggling with suggesting an EJB implementation for the database access or servlets that will access the database and issue the appropriate queries. One issue surrounding the database is that depending upon the user's login, they will be connecting to different databases. So, something would have to exist to determine which database to connect to and issue the queries.
    It sounds like the more object oriented approach would be to use an EJB architecture. If that is the case, since Java Web Start is what would be invoking the application, should a servlet invoke the EJB rather than directly from the application?
    Does the J2EE provide all that is needed to implement such an architecture? If so, what benefits do something like JBoss provide over Tomcat?
    I want to define the architecture before we start developing and any answers to the above questions or other suggestions are greatly appreciated.
    TIA

    So, something would have to exist to
    determine which database to connect to and issue the
    queries.Okay this could be a piece of logic after the user has provided username and password.
    Login page = JSP;
    Logic page = Servlet;
    It sounds like the more object oriented approach would
    be to use an EJB architecture. If that is the case,
    since Java Web Start is what would be invoking the
    application, should a servlet invoke the EJB rather
    than directly from the application?I haven't used Java web start, but the approach you use should depend on your products requirments for the services provided by the container.
    An EJB container provides massive advance over a servlet container, in terms of scalability, security etc.. and if this is necessary for your app then you should go with an EJB container. If not just go for some plain old servlets doing th SQL-DB access for you.
    Object orientation is the power of the java language, not specifically the power of the architecture. The architecture is based on some best practices. Do a search on the MVC pattern to learn more.
    Does the J2EE provide all that is needed to implement
    such an architecture? If so, what benefits do
    something like JBoss provide over Tomcat?Yes. JBoss provides the EJB container, Tomcat is the Servlet Container. They can be downloaded from JBoss together.
    I want to define the architecture before we start
    developing and any answers to the above questions or
    other suggestions are greatly appreciated.Good, that's the best thing to do. Design first. Take a look at Model View Controller.
    Regards
    T

  • Specification/Architectural question about EJBs and XML

    Hello,
    My problem is as follows: I would like for a session ejb to retrieve information from xml files (other that the ejb DDs of course...). I prefer the XML-file solution to the relational-database solution as it is more lightweight. (We haven't got the resources nor the skill to administrate a native xml database.) Am I allowed to read from the filesystem? What is the best architectural solution you would advise bearing in mind I need the information contained in the xml files to be available in java (in the session bean). Ideally I would drop xml files in a directory and they would automatically be parsed and taken into account by an ejb.
    I am available to provide more details if needed.
    Any clue welcome,
    Julien Martin.

    Hello,
    My problem is as follows: I would like for a session ejb to retrieve information from xml files (other that the ejb DDs of course...). I prefer the XML-file solution to the relational-database solution as it is more lightweight. (We haven't got the resources nor the skill to administrate a native xml database.) Am I allowed to read from the filesystem? What is the best architectural solution you would advise bearing in mind I need the information contained in the xml files to be available in java (in the session bean). Ideally I would drop xml files in a directory and they would automatically be parsed and taken into account by an ejb.
    I am available to provide more details if needed.
    Any clue welcome,
    Julien Martin.

  • EJB Architecture Question

    Hi everybody!
    As I am a newbie to EJB, but have to do a project with this technology, I have a basic question, that might seem very simple to the pros among you.
    I have to realise a system with an login at the beginning, but I am very unsure about how to realise this.
    I started by creating a table, holding the username and the password.
    Now I thaught about creating an enity bean, that checks if the user with the given password exists. Here is my first problem, entity beans only allow findbyPrimary() but i want to find a person by name and password. Is this possible? how?
    If the person exists in the DB i thaught about creating a new instance of an session bean, for the further transactions and pass the reference on to the user?
    Is this good?
    Please help!
    Thx in Advance!
    Stef

    You can certainly find a user via the name/password options. You need to implement a new finder for your entity bean - like findByUsernameAndPassword that accepts the 2 parms. The implementation is a little specific to the application server vendor, but it should be pretty easy to do regardless of the proprietary descriptors. Also, depending on the caching you're using on the enttity tier - using direct JDBC for along with entitiy beans can cause some issues. For example, you may have a specific instance of an entity bean that's cached in memory on the application server - they you change this using JDBC. The application server now has a stale version of the data - but it doesn't know that it's stale. Just some issues to consider.
    Cheers

  • EJB vs web services - architecture question

    I am about to be involved in architecting a new system that will have a very large amount of business rules. The application will be 3-tiered with the client application being a swing based java desktop application making requests of objects (ejb or other) to a j2ee application server.
    Im rather new to ejb development, having only built sample apps in the past. What im wondering is if there is a way to get around the RMI dependency for communitation between the client app and the server components. this is one reason im considering at least partial use of web services. ive become pretty good with apache soap, xml and seb services todate. however, i also need transaction support and im not sure if web services will do this yet. ive read about some work in this area.
    does anyone know of an (hopefully opensource) implentation of a SOAP-EJB and/or EJB-SOAP implementation layer ?
    The crux of the problem is that i need things like transactions and session management but i would like to communicate via soap and/or xml.

    Ive also seen a few examples of using a servlet as a request dispatcher to service the SOAP requests to EJB's. im just wondering if there was something available that will do this without having to roll my own so to speak. I want to be able to communicate with my ejb's over port 80, but in a secure way.
    Im also anxiously waiting for Apache Geronimo.

  • Entity EJB Relationships Architectural Question

    I need to create a hierarchy of simple objects. I will call my object
    "Part" for simplicity. I have two Oracle tables to maintain my Part
    hierarchy. The first table contains the detail for the part: number and
    name. The second table maintains the relationship: parent_number and
    child_number. I built Entity EJBs with CMP for both tables, but I don't
    know if that is the "best practices" approach. If it is, how do I define
    the relationships (EJB 2.0)? If it is not, how would you build it?
    Thanks for helping me out,
    Thomas A. Valletta

    Thanks Slava,
    You deserve more than a free trip to a conference for the time and effort
    that you put into this board. I think you should be able to write this off
    as a charitable contribution on your taxes. If you need someone to sign the
    receipt, just let me know.
    Anyway, back to my hierarchy issue(s). I found some information that
    weblogic will set-up this kind of many-to-many relationship for you if you
    set it up correctly in the weblogic-cmp-rdbms-jar.xml and the ejb-jar.xml.
    So I went through the DTDs, but despite the examples the help is extremely
    vague. Has anyone done this? Could anyone recommend where I could find
    something more on the topic (books, magazine articles, online documentation,
    code, etc)?
    Thanks again,
    Thomas A. Valletta
    "Slava Imeshev" <[email protected]> wrote in message
    news:3ec552f9$[email protected]..
    Hi Thomas,
    "Thomas A. Valletta" <[email protected]> wrote in message
    news:[email protected]..
    I need to create a hierarchy of simple objects. I will call my object
    "Part" for simplicity. I have two Oracle tables to maintain my Part
    hierarchy. The first table contains the detail for the part: number and
    name. The second table maintains the relationship: parent_number and
    child_number. I built Entity EJBs with CMP for both tables, but I don't
    know if that is the "best practices" approach. If it is, how do I
    define
    the relationships (EJB 2.0)? If it is not, how would you build it?The best approach is the one that works for you. If the
    combination of two beans works, leave it as is and
    go ahead with next tasks.
    Regards,
    Slava Imeshev

  • JSF MVC Architecture Question

    There seem to be two distinct schools of thought on this.
    1 group defines it as such:
    Model = Data
    View = HTML
    Controller = Business Logic and everything else.
    The other group defines it at as:
    Model = Data / Application Logic
    View = HTML
    Controller = accepts user input and instructs model and view to perform actions based on that input, ie. maps end-user action to application response.
    In the case of a JSF application specifically this would mean:
    .xhtml files = View
    POJO backing bean (containing application logic + Faces Servlet) = Controller
    POJO backing bean (containing data) = Model
    OR
    .xhtml files = View
    FacesServlet (the view handler, which processes requests / responses etc) = Controller
    POJO backing bean(s) (containing the data / application logic) = Model
    Any insight provided into this would be greatly appreciated.

    That's pretty interesting topic for me as a beginner and I'll try to talk about that at work and get deeper insight. If I learn something about it, I'll post it here. However I'd like to hear a bit from JSF gurus on that one :)

Maybe you are looking for

  • Problem at 'Extension Stores' of Sessions in Collaboration room template

    Hi, ALL: I make a change on 'Persistence Mode' of 'Session' from DB to FSDB. But, after create a test session to validate setting properly or not. Session record still save in the original KM folder (root\sessiondata), not in the specific folder. I a

  • Java Error message

    Can somepone explain what does this error mean?? I am trying to run the installation of Oracle 9i Application Server but this error comes up. I already installed Oracle 9i Database on the same machine and its running RH Linux 8. Any help is appreciat

  • Moving LR catalog to external hard drive

    I am new and in the process of learning LR.  Currently all my photos are stored and developed in my laptop, however it is getting too much for its hard drive.  I am thinkinng of moving the entire LR catalog to an external harddrive.  Would someone pl

  • Safari 6.0.5 unexpectedly quits

    Running 10.8.4 on my MacBook Pro and in recent days, Safari 6.0.5 unexpectedly quits. Not while I am working in it, but when the window is closed and the app is just running in the background. I get no alert that is has crashed, it just quits. I pull

  • What are all the tables used?

    hai, what r all the tables used for this report . <b>Created an interactive report in which sales orders were listed against different customers within the range selected. Selection of multiple sales orders were allowed for which checkboxes are provi