EJB Architecture

What is the reason/inspiration/motivation behind the EJB architecture the way it is?
Define two remote interfaces, one for the life cycle methods (Home) and one for the
business methods (Remote) and a bean class that is shielded from the client.
The client accessing the home interface to get a remote reference and so on.....

The main reason for EJB architecture is the business logic is completely shielded from other stuff like transaction management, database connection management, etc.
The main aim of EJB spec is to differentiate between the different role players.
For eg.
1. the application server providers provide support the EJB containers.
2. The EJB container providers support for Enterprise Bean developers.
3. The bean developers implement the business logic.
It makes life more simple for the Bean Developer since he does not have to worry about what security mechanism implementation the container has, or what fail over mechanism the application server provides.
Consider for example Weblogic Application Server. You code your business logic using EJB's.
While coding your EJB's you don't have to worry about database connection management, transaction management, security management, any network programming (say web-enabling your application), fail-over mechanism, load balancing algorithm and so on.
Rather the work load is distributed!!!
Hope this helps..

Similar Messages

  • Need EJB architecture diagram

    dear friends,
    I need EJB architectural diagram and if possible give me explanation also.
    thanks & regards,
    siva

    hi JavaDammGud,
    Thanks for ur help. i am new to EJB's . Now i found the way to move on EJB's. I searched with some key words. but i didnt understood the topics they given.
    thanking you,
    bye,....
    regards,
    siva

  • EJB architecture...HELP!!!!!

    Is EJB framework based on MVC Architecture ? If no,
    what is underlying architecture for EJB. This may sound
    stupid for most of you, because EJB itself is a framework
    for developing distributed,server-side, scalable, enterprise
    application components. But does EJB have it's origins on
    MVC Architecture.
    I was not able to corelate any similarities between the two.
    Please do let me know your views.
    Thanks
    Sanjay.

    The combination of EJBs, Servlets and JSP provide for a MVC framework usage in Java.
    Model = EJBs
    View = JSPs
    Controller = Servlets

  • 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

  • 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

  • Obtaining principal in EJB helper classes

    I have a pretty typical EJB setup where the actual EJBs delegate a lot of work
    off to helper classes which are simple java classes. Some of these helpers need
    access to the principal currently executing on this container thread. Currently,
    I am passing the principal as a parameter in every method signature on the helpers
    which need it. But as you can probably guess that approach is quickly becoming
    unweildy.
    Ideally, what I would like to do is to have access to the principal associated
    with the currently executing thread. I can mimic this by setting thread-local
    variables in the EJB prior to calling helpers. But I was wondering (ok, hoping)
    that there was already a way to access this information (either through weblogic
    classes or MBeans). At this point, I dont even care if it is not portable.
    P.S., I use WL6.1
    Thank you in advance,
    Steve

    >
    The helper methods do database querries etc and return results that the EJB sends onwards to clients. If these methods
    are NOT synchronized (and the ejbs share the static class) won't it cause concurrency errors? I think most of our methods are not
    synchronized (and it doesn't seem to cause any concurrency errors so far... though the system have not beeen stressed test that much,
    and concurrency bugs tends to pop up later and randomly :P).
    >
    No, if you dont have any static data variables in the Java classes, static method as such will not cause concurrency errors, and the methods should not be synchronized.
    If you have any synchronized methods and they take a while to execute, that could become a bottleneck in itself, because different threads waiting for each other,
    so make sure you dont have any synchronized methods where it is not explicitly needed.
    Think of a static method (without static data in the class being manipulated) as a plain function in another programming-language.
    >
    We have some scaleability problems with the EJBs... It seems as if they do not run concurrently. If we do a stress test with several threads calling the EJBs their response time increases by a too large factor to feel comfortable...
    >
    Apparently, you do have a some scaling/concurrency problem, which could have many causes -- transaction locking and clashes in the database, poorly configured database, network congestion, problems in the EJB architecture, etc -- can be many reasons...
    The general idea to debug, is first to find out exactly what calls in your code that take longest time to execute (profiling, logging, System.out.println's are useful) when you put parallel load on your system -- rather than just seeing "the whole application seems slow" -- from there you can move on, "divide&conquer" the problem, etc...

  • Help using JMS in a network/general architecture

    Hi everybody :
    We are working on the development of a distributed application. The architecture of the system is something like this:
    - A dispatcherthat receives requests (in a string shape) via http post. This unit has to encapsulate this request in a object and fordward such a petition to the correct service according a parameter of the request string.
    - A little number of services (4 or 5) that wait for requests delivered by the dispatcher. When a petition arrives, is attended to, and a response is sent to the client, using the http post that the client has used to send us the initial request. The computation complexity could be severe (access to DB, on-demand compilations, multimedia handling...).
    The distribution arises when we wanted to place each service on different machines due a heavy amount of requests.
    On a first approach, we are considering to use a servlet to manage the requests and JMS as middleware messaging service, as we want to provide an efficient communication layer between the modules of our application.
    Here come my doubts:
    - Would be the system more efficient if the service-providers are some kind of Enterprise Java Beans? And servlets?
    - I have readed the JMS and de JNDI tutorial. I have performed many tests in local mode, and i want now to do the same in a network mode... could somebody orient me? How do could i bind a connection factory with a specific resource across the network? In coding time or in deploying time?
    Help will be very very appreciated!!!!!
    Thank you very much for reading this message
    Greetings from Maria, Spain (europe)

    Hello Maria,
    You mention several things regarding architecture. I'll try to iterate them for you. As always this is just one persons idea/opionion.
    Receive Request from HTTP Posts. (Dispatcher)
    -- Sounds like an XML String morphed into an object via servlet. You could standardize on SOAP if it's not too much overhead.
    Services - High computation...
    Let jms receive and queue these requests. A service delegate can spawn threads to deal with the complex computations. I say Queue so you can cap the active thread count and pause the delegators thread creation due to any memory / cpu constraints...
    As far as JMS is concerned I'm unaware of your transactional requirements. In enterprise systems I have written, everything must be transacted and audited. JMS has a nice model for this. You could move to a pub/sub architecture as well.
    Scalability - (Distribution arises) - Each machine can maintain it's own queue and the servlets can distribute to them. Or you can pub/sub them via a dispatcher, it's own machine if desired - and let each machine act as a listener. A nice model as the amount of services grows.
    - Now that I've only reiterated what you've tried..
    Would be the system more efficient if the service-providers are some kind of Enterprise Java Beans? And servlets?
    -In my opionion for the high volume HTTP requests, servlets can lift the load.
    -You system has a high level of requests and load on your CPU. I'll also assume that transactions and auditing are required. As I'm sure you well know EJB is not the fastest animal in the forest. I would not use Message Driven Beans as you will have a hard time tunning performance within an EJB Container.
    - Now after I've said all that any fallout and persistance requrements from each service can leverage EJB's. Just remember that EJB's lend themselves well to web/commerce apps. I have no idea of your applications context so I'm taking a stab. There are wonderful tools in the EJB architecture, however, just because you've chosen Java doesn't mean you have to use EJB's. If speed in an issue for these services ( persisted or session level ) perhaps a mix is what your desire. ( I find session beans to be much better accessors than there sluggish entity brothers. )
    JNDI - Create a Service Locator that abstract the lookups for your services. Depending on how far you want to go. Our Service Locator can look up a multitude of contexts. Be it Weblogic/Websphere or a file system. There is no magic to it you just have to plug and play the contexts.
    "I have readed the JMS and de JNDI tutorial. I have performed many tests in local mode, and i want now to do the same in a network mode... could somebody orient me? How do could i bind a connection factory with a specific resource across the network? In coding time or in deploying time?"
    --I would take the performance hit on late binding and use caching to try and gain some back.  Below is a small example...
    -- All in all, It would help you to become more familiar with the EJB spec if your planning on that path. You soon come to notice it's features ( and particular quirks ).
    Good Luck,
    Hope this helps
    private String serverInstance;
    private String serverPort;
    /** Creates new ServiceLocator */
    protected ServiceLocator(String host, String port) {
    this.serverInstance = host;
    this.serverPort = port;
    public String getServerPort() {
    return this.serverPort;
    public String getServerInstance() {
    return this.serverInstance;
    private javax.naming.Context getInitialContext() throws javax.naming.NamingException {
    javax.naming.Context ctx = null;
    java.util.Properties prop = new java.util.Properties();
    prop.put("java.naming.factory.initial", "com.sun.jndi.rmi.registry.RegistryContextFactory");
    prop.put("java.naming.provider.url", "rmi://"+serverInstance+":"+serverPort+"");
    prop.put("java.naming.factory.url.pkgs", "org.objectweb.jonas.naming");
    ctx = new javax.naming.InitialContext(prop);
    return ctx;
    public Object getContainerService(String jndiName) throws javax.naming.NamingException {
    javax.naming.Context ctx = getInitialContext();
    java.lang.Object obj = ctx.lookup(jndiName);
    return obj;
    public static ServiceLocator getInstance(String host, String port) {       
    return new ServiceLocator(host, port);

  • EJB environment question (static helper classes)

    We're using JBoss as AS containing several stateless session beans.
    Now, we have certain helper classes that are abstract and contain static methods. Is this a problem for the EJBs? All of them use these helper classes all over their methods. Are they sharing the static class and will slow down somehow? Or is each EJB using its version of the class and can run concurrently?
    Should we rethink this and put an INSTANCE of each helper class in each ejb instead of using static methods in the helper class?
    Now in EJB method:
    Helper.calculateStuff();
    Should it be?
    Helper h = new Helper(); // defined when ejb is created
    helper.calculateStuff();
    Edited by: JAeon on Sep 8, 2008 12:21 AM
    Edited by: JAeon on Sep 8, 2008 12:22 AM

    >
    The helper methods do database querries etc and return results that the EJB sends onwards to clients. If these methods
    are NOT synchronized (and the ejbs share the static class) won't it cause concurrency errors? I think most of our methods are not
    synchronized (and it doesn't seem to cause any concurrency errors so far... though the system have not beeen stressed test that much,
    and concurrency bugs tends to pop up later and randomly :P).
    >
    No, if you dont have any static data variables in the Java classes, static method as such will not cause concurrency errors, and the methods should not be synchronized.
    If you have any synchronized methods and they take a while to execute, that could become a bottleneck in itself, because different threads waiting for each other,
    so make sure you dont have any synchronized methods where it is not explicitly needed.
    Think of a static method (without static data in the class being manipulated) as a plain function in another programming-language.
    >
    We have some scaleability problems with the EJBs... It seems as if they do not run concurrently. If we do a stress test with several threads calling the EJBs their response time increases by a too large factor to feel comfortable...
    >
    Apparently, you do have a some scaling/concurrency problem, which could have many causes -- transaction locking and clashes in the database, poorly configured database, network congestion, problems in the EJB architecture, etc -- can be many reasons...
    The general idea to debug, is first to find out exactly what calls in your code that take longest time to execute (profiling, logging, System.out.println's are useful) when you put parallel load on your system -- rather than just seeing "the whole application seems slow" -- from there you can move on, "divide&conquer" the problem, etc...

  • Live discussion on "EJB Performance Verification"

    Empirix, the maker of the Bean-test EJB testing tool, is offering a
    free one hour web event presentation called "Enterprise JavaBeans
    Performance Verification". This event will be held this Friday
    November 16th at 2pm EST.
    To register for this web event or learn about about web events being
    offering by Empirix, go to: http://webevents.empirix.com/Q42001/
    Enterprise JavaBeans Performance Verification
    Enterprise Java Beans (EJBs) are the central components in a
    Java-based enterprise architecture solution. They contain the business
    logic for an enterprise system and implement the communication between
    the Web-tier and database tiers. EJBs typically are architected and
    implemented for months before integrating with the Web-tier hardware
    and software. Waiting to verify the scalability of the overall EJB
    design and the efficient implementation until late in the software
    project with a Web test tool is risky and may cause the entire
    software project to fail.
    Due to the important role EJBs play, performance testing of the EJB
    architecture and implementation is critical during the entire design
    cycle, the test cycle, application server tuning, and with any
    hardware and software environment changes. Manual vs. automated EJB
    component verification strategies will be discussed. During the
    presentation, we will show how an example EJB will be scalability
    tested using Bean-test, Empirix's automated EJB component test tool.
    We will show how Bean-test automatically creates a test harness,
    exercises an EJB under load, isolates a scalability problem, and
    confirms an implemented correction to the scalability problem is
    successful.

    Note, there is a replay of this free web event on Monday, December
    10th at 2pm EST for those who could not make it the first time.
    Steve
    [email protected] (Steven Kolak) wrote in message
    Empirix, the maker of the Bean-test EJB testing tool, is offering a
    free one hour web event presentation called "Enterprise JavaBeans
    Performance Verification". This event will be held this Friday
    November 16th at 2pm EST.
    To register for this web event or learn about about web events being
    offering by Empirix, go to: http://webevents.empirix.com/Q42001/
    Enterprise JavaBeans Performance Verification
    Enterprise Java Beans (EJBs) are the central components in a
    Java-based enterprise architecture solution. They contain the business
    logic for an enterprise system and implement the communication between
    the Web-tier and database tiers. EJBs typically are architected and
    implemented for months before integrating with the Web-tier hardware
    and software. Waiting to verify the scalability of the overall EJB
    design and the efficient implementation until late in the software
    project with a Web test tool is risky and may cause the entire
    software project to fail.
    Due to the important role EJBs play, performance testing of the EJB
    architecture and implementation is critical during the entire design
    cycle, the test cycle, application server tuning, and with any
    hardware and software environment changes. Manual vs. automated EJB
    component verification strategies will be discussed. During the
    presentation, we will show how an example EJB will be scalability
    tested using Bean-test, Empirix's automated EJB component test tool.
    We will show how Bean-test automatically creates a test harness,
    exercises an EJB under load, isolates a scalability problem, and
    confirms an implemented correction to the scalability problem is
    successful.

  • EJB:What is a Business Interface ?

    Hello,
    I am using netbeans 5.5 and creating a stateless bean.
    I have the following files in my enterprise application:
    ConverterBean.java: This is my Bean.
    ConverterRemote.java: This is my Remote Interface.
    ConverterRemoteBusiness.java: Business Interface ??? .. never heard of it before..Netbeans created this one automatically.
    ConverterRemoteHome.java: This is my Home Interface.
    Help me out ..here.

    newark wrote:
    [http://java.sun.com/javaee/5/docs/tutorial/doc/bnbnc.html]
    Search that page for business interfaceSuppose we have MulletBean. Its business in the front, party in the back. But hows does the EJB architecture capture this?

  • Web Services - Servlets vs EJBs

    Hi,
    Looking for any suggestions about the benefits of using either servlets or EJBs as web service endpoints. Very early in the design of any application, I wish to expose my business logic components as web services, is there any particular benefit to using a specific approach (i.e. using either EJBs or Servlets as the end points of the web services exposing the business logic)?
    This is a totally new application so I have no considerations towards reusing old EJB code, etc. My initial thoughts favour using servlets, if only because it reduces the complexity / resources required for the application server (i.e only Web-container required, rather than Web & EJB container).
    Any thoughts please?

    Why do Servlets not scale as well? Surely they are
    more "lightweight" than an EJB (which has all theRMI
    overhead), and wouldn't it ultimately be down tothe
    underlying app server anyway?Right, but servlets are just HTTP request listeners.
    They aren't components, they aren't transactional,
    they don't handle persistence, they don't have
    naming services, they don't have queuing services.
    The EJB container offers you a lot.
    With that said, it's not just a choice between
    servlets and EJBs. You can use POJOs and avoid EJBs
    altogether if you do it right.
    Or choose the best of both worlds and mix 'n match as needed.
    Noone forces you to choose one over the other (at least not for any technical reasons, I'm not diving into corporate politics here).
    My thought was that web services were a better wayto
    expose business logic than EJBs, but if there some
    solid reason why this isn't the case I like toknow.
    Web services - lightweight? Maybe that's true of
    REST, but certainly not SOAP. There's an argument
    that says services are more heavyweight than EJBs,
    because all the XML on the wire is an expensive
    protocol.
    SOAP is heavy on the network, but it's essentially a rather thin layer on top of other services (if properly architected).
    For example we have a SOAP layer exposing a Spring application which proxies an EJB architecture.
    Next to that SOAP layer sits a traditional web application (servlets) which itself has a Spring application sitting on top of it for demonstration and testing purposes.
    And then there's an SDK allowing direct access to the Spring layer (and thus almost direct access to the EJB layer).
    That's the beauty of a true open architecture, each component can be built on top of another and the component underneath can function just fine without it.
    Look into Spring:
    http://www.springframework.org
    It's a lighter alternative to EJBs, and good plumbing
    for any Java EE app.While Spring can serve as an alternative for EJB in places where EJB are overkill it's of course not in competition with it.
    Spring is a service layer, making use of other technologies (like EJB, like AOP, like ORM) to provide data and other services (like Struts, like JSF, like JSP) to provide that data to requesters.

  • UML to EJB

    Hi all,
    i am using Sun Java Studio Enterprise 8.1 and i see there is a UML-Tool. Can i model with this UML-Tool an ejb-architecture? if yes, please say me how, or is there anyone tutorial or document to learn that.

    Sun Java Studio Enterprise 8.1 is based on NetBeans 5.0 (and provides features such as UML modeling as add-ons to NetBeans 5.0). Since then UML module itself has been open-sourced and is being developed at netbeans.org.
    For UML modeling, you may want to work with the latest versions of NetBeans and install the UML module add-on on top of it.
    - NetBeans 5.5.1
    Download and install the ide from http://www.netbeans.org/
    Bring up the ide and use 'Tools | Update Center' menu to download and install UML module from the Update Center
    - NetBeans 6.0
    You can download the latest milestone of NB6 from http://dlc.sun.com/netbeans/download/6.0/milestones/latest/ .
    uml.netbeans.org provides the starting page for UML module. From here there are links to documentation, faqs, blogs and other information.
    Regarding EJB support:
    UML for NetBeans 5.5 supports design patterns for ejb:
    From http://www.netbeans.org/products/uml/:
    here is a full set of predefined and extensible design patterns including EJB 1.1,
    EJB 2.0 and Gang of Four (23 patterns).The article 'Designing Patterns With UML' at http://developers.sun.com/jsenterprise/nb_enterprise_pack/reference/techart/uml_patterns.html is for a slightly older version but should still apply.
    EJB code generation is not currently supported but is on the roadmap:
    http://wiki.netbeans.org/wiki/view/UMLRoadmap

  • Converting to EJB

    We have developed our product using MVC design, not using EJB.
    Structure like follows,
    View (JSP)------->control(servlet)------->model(java bean).
    Model:
    We have two types of ordinary java bean. that are,
    DAO----->It handles all the busness logic mehtod.It calls another bean called DBAccess for
    database access.
    DAO Model---->It has all set and get methods for particular process.
    Control:
    Just navigating part between view and Model.
    Please give me suggestions to convert this architecture into EJB architecture.

    Hi
    I think the best option is you can go for DB read operation with DAO. In the case of insertion, deletion and updation go for Entity bean. This differentiation can be done from the existing business class. Introduce a SessionFacade as wrapper of your business service. Also follow common J2EE design patterns.
    HTH
    Jobinesh

  • Static variable in session bean

    Can we declare static variable in session bean. If we declare what will happen. Will it create error in compile time or not deployed in server.

    From a Java language perspective, nothing stops you from declaring a static variable in a session
    bean class. It will compile as long as its syntactically correct.
    From an EJB programming model perspective, the use of non-final static variables
    is discouraged because it breaks the JVM-transparency that is an important aspect of the
    EJB architecture. It should be possible to deploy a single EJB application to a cluster and
    have it behave exactly as if it were deployed to only one server instance (albeit with higher
    overall throughput/performance). Using non-final static variables breaks this property
    because the bean instances in one JVM will see a different value for the static variable
    than bean instances in a different JVM.
    It also forces you to deal with synchronization
    of the shared data, which is a complexity that was carefully avoided in the EJB programming
    model by ensuring that each bean instance is single-threaded.
    Bottom line is you can have "final static" data members in EJB classes but you should
    avoid non-final (mutable) static data.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Best way to use PersistenceManagers in Web Applications

    Beacuse each PersistenceManager manages it's own cache , and I would like
    to benefit from this cache is it a good practice to keep in each user's
    session a PersistenceManager instance? By keeping this cache , wouldn't be
    a problem when many users access the application at the same time.
    Another approach would be to keep it in the servlet context but because
    each instance of a PersistenceManager makes a transaction at once, that a
    performance problem shall appear.
    Of course I'd like to decouple the persistence operations so I wrote a
    stateless session bean (as recomended), and when each metod is called I
    obtain a new PersistenceManager instance I use it and that at finish I
    close it.
    Lets say that I have a one-2-many relationship between 2
    PersistenceCapable objects Company and Employee. Let's say that I call the
    method findCompanyByPK(Object pk) in the session bean. I obtain the PM
    instance, I use pm.getObjectById() than I close the PM instance and return
    the result. What if I want to access the company employees form the
    instance returned. The PM is closed so I shall get an Exception. And
    anpther thing, if I close the PM instance , how do I benefit from the
    cache??
    Can anybody show me a better approach?

    Patrick Linskey wrote:
    In article <[email protected]>, Danix wrote:
    How can I achieve this PersistenceManagerFactory cache?
    Seehttp://www.solarmetric.com/Software/Documentation/2.3.4/docs/datastore_cache.html
    for details on using our PersistenceManagerFactory cache.One question here: Each object that I use and store in cache must be
    pinned and unpinned from the cache manually by me or is it made
    automatically by PMF?
    One thing I liked about JDO was lazy loading. Lets say that my company has
    a few thousand employees , as I know objects are loaded from datastore
    only when they are iterated, so as you say wouldn' t be a solution to
    retrieveAll employees and make all of them transient. Isn't there a better
    alternative?
    Well, not really, if you are set on using session beans. One of the important
    functions that session beans play in many EJB architectures is that of a data
    firewall, ensuring that only authorized clients can access certain data. So,
    the data that the session bean methods return cannot be associated with a
    live connection to the database, as this would cause your client tier to
    directly access the database, which the EJB folks say is A Bad Thing.
    Now, because this can lead to performance problems, and because most people
    don't need this type of security between their web server and their database,
    the EJB folks often propose what Sun refers to as the Fast Lane pattern, in
    which data is read directly from the database by the web server to realize
    performance improvements.
    Many J2EE applications can be best implemented (from the standpoints of
    simplicity, performance, and cost) by only using session beans whenabsolutely
    necessary, rather than as an integral part of your three-tiered design.
    You can easily enough design an architecture that separates presentation
    logic from business logic, but only delegates that business logic to asession
    bean when the services of a session bean are necessary. That is, you do not
    necessarily need to use a session bean just because you want this separation.
    So, if you were to go that route, and perform business logic in the same JVM
    as your servlet/JSP, then you could see the benefits of lazy loading, since
    you could keep the PM open until the presentation logic finished executing.
    But, if you need the extra facilities of session beans, then you're pretty
    much stuck with statically returning all the data that the session bean plans
    to make available to the client.You are right maybe stateless session beans are not the best approach. Can
    you explain to me a little about PerristentManagers? My opinion was that
    the PMF when is instantiated creates a pool of PMs. Each of them uses a
    cache that is initialized from datastore when is obtained first time from
    PMF and when PM is closed , it is actually returned to the PMF pool and
    its cache is not lost? Is it somethisng like this?
    And thank you for your quick answers so far.
    Dan
    -Patrick
    Patrick Linskey [email protected]
    SolarMetric Inc. http://www.solarmetric.com

Maybe you are looking for

  • Can Disk Utility make a "New Image" from a desktop copy of a DVD?

    I have not been able to get Disk Utility to make "new images" of a couple of DVDs. For one of the DVDs, it may have something to do with a hyphen in the title. I haven't a clue why I'm failing with the second of the two DVDs. (Previously, I've had no

  • ICal not showing calendar list, crashing frequently

    I just upgraded from Snow Leopard to 10.7.2 a few days ago and I've found iCal to be extremely buggy.  In addition to frequent crashes, I am unable to see my calendars in the Calendars list.  Here's what I get when I click on it: Is anyone else exper

  • Transactional Figure in BPC

    Hi All, I have situation here, I'm loading a .CSV file with column on GL Account and Cost Centre and Val in Rep Cur, after scheduling package I get error message "Mapping error: The dimension does not exist in the application. [VAL.IN REP.CUR.] Ideal

  • RC00 condition type

    RC00 is a quantity condition type.In a sales order i am giving the value as 10 per piece.however it is taking the 10 to be the amount in rupees and subtracting this discount in the net value.Please help clear the condition about this condition type a

  • Import file from Excel and ignoring the headers

    Hi all, is it possible to import files(spreadsheets) from Excel and ignoring the first row that contains the headers? Since headers might contain special characters such as "\n", "&" and "/", i wonder if you can tell me how to load .xlsx files while