About EJB 3.0 ?

i don't know anything about EJB (nither EJB 3.0 nor any previous version )
i want to learn EJB 3.0, but the final version of 3.0 EJB 3.0 has not been release.
i have heard that in EJB 3.0 all the old concepts have been changed.
a) will it be a good idea to start learning the latest version (version prior to 3.0)
and to get familiar with EJB and then later upgrade ?
or
b) wait for the EJB 3.0 and start learning EJB 3.0 only when its final version comes
please give me a helpful suggestion

This is a late feedback on your question but now JSR220: EJB 3.0 now is in its "Proposed Final Draft" stage.
http://java.sun.com/products/ejb/docs.html
I feel that starting afresh with EJB 3.0 is not a bad idea because there are some major changes in the way EJBs will be developed in future.
Knowing EJB 2.x is always a plus and you would certainly appreciate the new incarnation for its simplicity.
Hope this helps.
Cheers,
-_.

Similar Messages

  • Know about EJB.

    Hi,
    I dont have any idea about EJB and also how the EJB is differ from java beans.
    Thanks in advance.

    Romain - I think the answer to your question is that the information
    identifying the user is passed into the initial context parameters. Weblogic
    uses this to propagate the security context from the servlet container to
    the ejb container.
    cheers,
    Markus
    "romain" <[email protected]> wrote in message
    news:3b0e8b23$[email protected]..
    >
    Hi
    perhaps it is a dummy question but I didn't find any explicit answer.
    I'd like to know how the ejb can know if a user belongs to a role.
    For example if I want to access my ejb with a servlet, and this servlet isprotected
    (access allowed only for group customer)
    and in my bean's deployment descriptor I have protected one method withthe security
    role customer)
    What I am wondering is when the user is authenticated in the servlet as acustomer
    and then try to access the method how the ejb knows that this user is inthe group
    customer??
    Is this information included in the http session or in the initialcontextcreated
    in the servlet or somewhere else??
    thanks for your help
    romain

  • A question about EJB timeouts

    Good day!
    I encountered an interesting situation about EJB timer service.
    1) For example, I created an implementing TimerObject Stateless Session Bean.
    2) In ejbSetSessionContext method I created an timer to invoke ejbTimeout on my EJB every 15 seconds.
    3) Ok. Container invokes this ejbTimeout every 15 sec. But what happens is previous ejbTimeout didn't returned because it is waiting for some connection for example. Would container invoke ejbTimeout while processing previous ejbTimeout on this one Stateless EJB?
    I looked in EJB 2.1 spec. but didn't find corresponding answer.

    Hi russiandroopy,
    This isn't specifically mentioned in the spec because the design center of the Timer Service was not fine-grained events. The spec suggests that typical timeouts would be on the order of minutes or hours, which is typically much longer than the duration of the handling time within a timeout method or business method. In SUN's implementation we do not attempt to deliver a subsequent periodic timeout until the previous timeout completes successfully.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Where to get good tutorial about EJB 3.0

    I would like to find some good tutorial about EJB 3.0, any suggestions where I can get it?
    thanks

    JavaEE 5 Tutorial:
    http://java.sun.com/javaee/5/docs/tutorial/doc/
    Sun Java System Application Server Developer's Guide:
    http://docs.sun.com/app/docs/coll/1343.3
    Glassfish EJB FAQ:
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html

  • Excellent resources about EJB Transactions

    Is there any good (better, excellent) web resource (or book) about EJB Transactions, covering topics like
    - Flat Transactions vs. Nested Transaction
    - Using EJB EntityBeans & Hibernate together: pay attention to Transaction Isolation
    - Transaction Isolation examples, especially when having suspended transactions?
    Thank you for any hint.
    Michael

    Nothing's better than Google.
    Rich

  • Where can I get the material about EJB Design?

    I am working with EJB for a short time.I know that a
    well-designed architecture is very important.So I want to learn more about the EJB Design.Can anyone tell me where to find such material?And which book shall I choose?
    Thank you.

    if you are doing some browse-server design using ejb, I think you can read the sun's blueprint of j2ee, and study the sample application - pet store.
    best regards.

  • About EJB deployment descriptor

    Hello. I am developing EJB3 with glassfish and weblogic 10. I know I can use annotations to simplify
    deployment without using ejb-jar.xml , sun-ejb-jar.xml, weblogic-ejb-jar.xml. However, I do want to know
    how to write these files correctly because they have higher priority when used.
    Somebody may give me a template about writing these files? (ejb 3 specification, for ejb2, I can
    use xdoclet to generate them).Thanks a lot.

    Hi Martin,
    you're are right, XDoclet support for OC4J is lacking the most important stuff. In my case I needed explicit mapping of CMR-fields. Of course, manually editing orion-ejb-jar.xml either by using a text editor or JDeveloper is no option at all.
    So I've added support for explicit CMR-mapping to the OC4J XDoclet templates. It works but wasn't fun to do as Oracle's documentation of CMR-mapping is highly inconsistent (e.g. text, figures, and example code are not in sync).
    As I've done this as part of a services contract, I cannot easily publish the results. I'll ask my client and let you know.
    Anyway, orion-ejb-jar.xml will be obsolete by default in OC4J 10.x as Oracle switches to Toplink as the default persistence manager. So again, XDoclet support is needed for generating the Toplink-specific deployment descriptor.
    I'd really appreciate Oracle to provide OC4J-specific XDoclet enhancements. This would help OC4J in gaining wider acceptance.
    Stefan

  • Question about EJB and thread safe coding - asking again!

    sorry everyone, no one seems to be interested in helping me on this, so i post it again.
    i have a question about the EJB and thread safe coding. when we build EJBs, do we need to worry about thread safe issue? i know that EJBs are single threaded, and the container manages the thread for us. maybe i am wrong about this. if i wasnot, how can we program the EJB so that two or more instance of EJB are not going to have deadlock problem when accessing data resources. do we need to put syncronization in ours beans, do we even need to worry about creating a thread safe EJB? thanks in advance. the question really bothers me a lot lately.

    sorry everyone, no one seems to be interested in
    helping me on this, so i post it again.Excellent plan. Why not search a little bit on your own instead of waiting for your personal forum slaves to answer your call. See below.
    i have a question about the EJB and thread safe
    coding. when we build EJBs, do we need to worry about
    thread safe issue? Read this: http://forum.java.sun.com/thread.jsp?forum=13&thread=562598&tstart=75&trange=15
    i know that EJBs are single
    threaded, and the container manages the thread for us.
    maybe i am wrong about this. if i wasnot, how can we
    program the EJB so that two or more instance of EJB
    are not going to have deadlock problem when accessing
    data resources. do we need to put syncronization in
    ours beans, do we even need to worry about creating a
    thread safe EJB? thanks in advance. the question
    really bothers me a lot lately.
    Java's Thread Tutorial
    JavaWorld: Introduction to Java threads
    IBM: Introduction to Java threads
    Google: java+threads+tutorial

  • About EJB problems

    Hi,
    When Coding the EJB,I encounter some errors,pls look following errors:
    "the finder ejbPrimaryKey(java.lang.Interer return an unexpected type.Finders in the
    bean class must return the primary key type, java.util.Collection, or java.util.Enumeration;"
    I know the java.lang.String is the primary key type,but I don't know wether the java.lang.Integer is a
    pimary key type?
    if the java.lang.Integer is not a primary key type,I should why to slove the problem?
    thanks very much!!!!
    fxie

    Hi
    When I post it, the system tell me errors about posting,and let me try again post it.
    So,I posted some same content posting!
    Thanks,

  • Extremely difficult to debug, about EJB, JSP

    These codes are in a JSP page, an EJB will be looked up:
    addcd.jsp
    <%!
       private CDAdder cdadder = null;
       public void jspInit() {
          try {
             InitialContext ic = new InitialContext();
             Object objRef = ic.lookup("CDAdderBean");
            CDAdderHome home = (CDAdderHome)PortableRemoteObject.narrow(objRef, CDAdderHome.class);
             cdadder = home.create();
          } catch (RemoteException ex) {
                System.out.println("Remote Exception:"+ ex.getMessage());
          } catch (CreateException ex) {
                System.out.println("Create Exception:"+ ex.getMessage());
          } catch (NamingException ex) {
                System.out.println("Unable to lookup home: " + ex.getMessage());
       public void jspDestroy() {   
             cdadder = null;
    %>
    <%
    HttpSession httpsession=request.getSession();
    httpsession.setAttribute("cdadder",cdadder); //i want to add this object to the session so that i could retrieve it and use its methods in other JSP pages.
    %>
    <form method="post" action="addtrack.jsp">
    <input type=text name="TitleOfTrack">
    <input type=text name="DurationOfTrack">
    <input type="submit">
    </form>
    ......................................addtrack.jsp
    <%
    CDAdder cdadder=(CDAdder)request.getSession().getAttribute("cdadder");// get back the object in the session
    String TitleOfTrack=request.getParameter("TitleOfTrack");
    String DurationOfTrack=request.getParameter("TitleOfTrack");
    cdadder.addTrack(new Track(TitleOfTrack,DurationOfTrack) ); //add the Track object into the arraylist using the addTrack(Track track) method in the CDAdderBean
    response.sendRedirect(addcd.jsp); //redirect back to the addcd.jsp page
    %>CDAdderBean.java
    public class CDAdderBean implements SessionBean {
         // data item to hold a reference to a passed Session context     private SessionContext ctx;
         private ArrayList tracks=new ArrayList();   << This arraylist holds the Track objects
         public void addTrack(Track track) throws RemoteException{
              tracks.add(track); //one method for adding tracks to the arraylist
         public void removeTrack(int index) throws RemoteException{
              tracks.remove(index); //another method for removing a track from the arraylist
         public ArrayList getListOfTracksAL() throws RemoteException{
    return tracks;
    ...............................Each time the user enters the required fields(title,duration) to add a track, these parameters will be passed to the addtrack.jsp, and the addtrack.jsp will retrieve the cdadder object from the session and use its addTrack method to add the track to the arraylist. And when it finishes, it will redirect back to the addcd.jsp. I got some other codes in the addcd.jsp(I did not show it as it will look very messy), anyway, the codes includes a call to the getListOfTracksAL() method which will return an arraylist of Track objects.
    my problem is that, EVERY TIME i started the sun application server, and go to the addcd.jsp, then the FIRST TIME I entered all the required fields and click submit button . I expected the parameters would be passed to the addtrack.jsp and it would add the track to the arraylist for me and then returned to addcd.jsp and the addcd.jsp would display the track that I just tried to add.
    but it didn't.
    I am sure that it DID add the track to the arraylist because i tried to print the size of the arraylist after the addTrack method was invoked.
    the most strange thing was that the addcd.jsp would display the tracks correctly after the FIRST TIME of adding a track.
    Please take a look at this link if you have time:
    http://222.166.192.130:8080/E-Music/login.jsp
    username:aaaaaa
    password:aaaaaa
    choose the role as "Admin"
    Add new music recording
    note: processor.jsp in this web server is the addtrack.jsp I was referring to.
    Many thanks to you all.

    ya
    i tried to add some println statements and noticed that:
    the first time i tried to add a track, the addTrack method was really invoked and the size of the arraylist became 1
    but when it returns to the addcd.jsp page the arraylist became empty
    but the most strange thing was that, it worked correctly AFTER the first time.
    thank you very much for your advice.

  • Questions about EJB local interfaces - 9iAS 9.03

    Intro: I am new in developing EJB, and I am trying to build an example to verify that a stateless session bean with local interfaces is quite efficient.
    Q1: I have read that an application trying to access local interfaces of an EJB must run into the same JVM. Does it means that it should be deployed into the same OC4J instance as the servlet?
    Q2: I am using JDev 10g to build the EJB, with local and remote interfaces. Using the internal OC4J container, I can use the remote interfaces but not the internal one: an object of class "_Proxy1" is returned after the lookup (with the same name as given for the remote interface related call). Is it possible to access the local interface?
    Q3: My application architecture is already defined to split the business logic in two EJBs: one stateless session bean for volatile data and one entity bean for a global user list cache. Where can I find a working example (with source code, please) to be deployed on 9iAS that can validate my design?
    Q4: In many places, I read that CMP entity bean are easier to develop than BMP one. Is there any special consideration I should be aware of before implementing a CMP for my global user list cache?
    Thanks a lot, Dom.

    I have just read:
    I think the problem is that local interfaces can only by
    accessed through the same container, and JSP/Servlet's
    one is different from EJB's one, regardless of you many
    application server's instances do you have... Hope this
    is the answer...Is there anyone who know if it applies too to 9iAS?
    A+, Dom

  • Runtime information about EJB on weblogic console

    Hi All,
    I am using WLS6.1 sp2 on Redhat Linux 7.2.
    The runtime information for an EJB as displayed on weblogic console looks very
    odd. Could somebody clarify the meaning of the following mbean info?
    Beans in Use Count(BeansInUseCount)
    Cache Beans Current Count(CachedBeanCurrentCount)
    For one of my entity EJBs, I see
    BeansInUseCount=30678,CachedBeanCurrentCount=3674578
    I have max-beans-in-cache=1000 for all entity beans and the number of records
    for this entity EJB in database is less
    than 10. I dont understand why the BeansInUseCount is so high?
    This number looks very suspicious. Is this a bug or maybe a memory leak?
    Any assistance will be greatly appreciated.
    Thanks,
    Abhay

    Please transfer to EJB Forum...

  • More explaination needed about EJB issues published

    when I read the part of "EJB issues" of the page
    http://otn.oracle.com/products/jdev/htdocs/readme_903Preview.html#viadcm
    I have several questions:
    first one:
    Invalid column name when the primary key in one table is different from the foreign key name. (2514361)
    does that mean that the foreign key in table 2 should have the same name as the primary key in the table 1?
    second one:
    Null pointer exception when an EJBSelect() method is called. (2428884)
    does that mean you can not call EJBSelect in your code?
    third:
    Pure MDB cannot run in an embedded OC4J server but can be deployed to a standalone OC4J server.
    "can be deployed" means MDB can run on standalone OC4J, right?
    last one:
    If a CMR exists between two CMP entity beans with the same Primary Key names than the association table generated is incorrect - Workaround is to make sure that primary key names don't match
    All my entity beans use uniqueId as the primary key. In the association table we are using other name as the foreign key. can I use orion-ejb-jar.xml to explicit mapping to overcome this problem?

    Hi Han -
    I had a further look through the bug database for the numbers you specified:
    Invalid column name when the primary key in one table is different from the foreign key name. (2514361) :
    - the base OC4J bug for this has been fixed in the 904 code line and will be in 904. If this is causing you problems with 903, then I recommend you call Oracle support and log a TAR. They may be able to have the base bug for this backported to 903 as a patch.
    You may also want to try deploying this using the non-association table operation mode. You can start OC4J with a system property of "-DassociateUsingThirdTable=false" which will force the container to use pk/fk columns in the direct tables for 1-M relationships rather than the association table. I don't know if this will resolve the specific problem you have, but it is worth trying.
    Null pointer exception when an EJBSelect() method is called. (2428884) : the base OC4J bug for this was fixed in the production release.
    If a CMR exists between two CMP entity beans with the same Primary Key names than the association table generated is incorrect - try using the non association table operation mode.
    Pure MDB cannot run in an embedded OC4J server but can be deployed to a standalone OC4J server. - I pointed out the area of the JDeveloper documentation where this problem and solution is discussed in an earlier post in this thread.
    Hope that helps you somewhat. You mentioned that you were still having a problem - can you post a new thread which has more details of the nature of the problem, stack traces, etc. so we can look at that separately.
    cheers
    -steve-

  • Info about EJB

    Hi all, here's my simple situation...
    i have an Entity Bean (EJB 1.1) in my application which return a Collection through a findByPrimaryKey method (another method return also a Collection through a findByCOLUMN_NAME method). Is it possible to order my returned Collection by a field, or there is a limitation for EJB 1.1?
    Thanks in advance
    Fabio Petrillo

    I suggest starting with JavaEE 5 Tutorial.
    http://java.sun.com/javaee/5/docs/tutorial/doc/
    Part Three: Enterprise Beans
    Part Four: Persistence (Java Persistence API)

  • 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.

Maybe you are looking for