J2ee Ejb specification 2.0

Hi,
The latest Specifications for EJB 2.0 available on Sun's site talks about Entity Bean - bean managed persistance in Chapter 12 (page 257 - 258), where it states that
Bean Method bean method can
perform operations
-------------------------------------------------------ejbLoad/ejbStore Entity Context method :
getEJBHome, getEJBObject,
getcallerPrinciplal, getPrimaryKey,
getRollBackOnly, setRollBackOnly...
Business Method Entity Context method :
getEJBHome, getEJBObject,
getcallerPrinciplal,
getPrimaryKey, getRollBackOnly,
setRollBackOnly...
As per the above table, getRollBackOnly and setRollBackOnly methods can be used in different bean methods and container callback methods in Entity bean - Bean-Managed Persistence.
But as per our knowledge, the above methods can ONLY be used with Container Managed persistance beans.
Could you help me out in clearing the above confusion?
Thanks,
Gauri Tendulkar
Patni Computer Systems Ltd.
Sr. Software Engineer.

Hi!
getRollBackOnly and setRollBackOnly affects transactions of this bean, and transactios are handled by the container in any case (although you may begin and end usertransactions in the bean yourself). In the deployment-descriptor you specify how transacions should be handled for this bean (TX_REQUIRED, TX_SUPPORTED, ...)
I think even if you perform no transaction at all in the bean, you may use setRollBackOnly to mark the transaction currently open for rollback.
Hope this helps, ciao
Martin
Hi,
The latest Specifications for EJB 2.0 available on
on Sun's site talks about Entity Bean - bean managed
persistance in Chapter 12 (page 257 - 258), where it
states that
Bean Method bean method can
perform operations
jbLoad/ejbStore Entity Context method :
getEJBHome,
getEJBHome, getEJBObject,
getcallerPrinciplal,
getcallerPrinciplal, getPrimaryKey,
getRollBackOnly,
getRollBackOnly, setRollBackOnly...
Business Method Entity Context method :
getEJBHome,
getEJBHome, getEJBObject,
getcallerPrinciplal,
getcallerPrinciplal,
getPrimaryKey,
getPrimaryKey, getRollBackOnly,
setRollBackOnly...
As per the above table, getRollBackOnly and
setRollBackOnly methods can be used in different bean
methods and container callback methods in Entity bean
- Bean-Managed Persistence.
But as per our knowledge, the above methods can ONLY
be used with Container Managed persistance beans.
Could you help me out in clearing the above
confusion?
Thanks,
Gauri Tendulkar
Patni Computer Systems Ltd.
Sr. Software Engineer.

Similar Messages

  • ERROR J2EE EJB-03027 with OC4J 10.1.3.3

    Hi,
    we have an application that works fine in iAS 9i (9.0.3).
    Now, we have to migrate the platform to 10G and we are testing with OC4J 10.1.3.3.
    But when the OC4J works... we see this message:
    2008-03-06 16:10:12.737 ERROR J2EE EJB-03027 [prueba] Se ha producido un error al desplegar el módulo EJB: java.lang.InstantiationException: Internal server error: oracle.classloader.util.AnnotatedClassFormatError (Bad version number in .class file
         Clase no válida: UPHome_EntityHomeWrapper1
         Cargador: prueba.root:0.0.0
         Origen de Código: /C:/OC4J 10.1.3.3/j2ee/home/application-deployments/prueba/MGU-1.0/deployment-cache.jar
         Configuración: <ejb> in wrappers
         Clase Dependiente: com.evermind.server.ejb.deployment.EntityBeanDescriptor
         Cargador: oc4j:10.1.3
         Origen de Código: /C:/OC4J 10.1.3.3/j2ee/home/lib/oc4j-internal.jar
         Configuración: <code-source> in META-INF/boot.xml in C:\OC4J 10.1.3.3\j2ee\home\oc4j.jar
    08/03/06 16:10:12 ADVERTENCIA: Application.setConfig Application: prueba is in failed state as initialization failed.
    java.lang.InstantiationException: Error initializing ejb-modules: Internal server error: oracle.classloader.util.AnnotatedClassFormatError (Bad version number in .class file
         Clase no válida: UPHome_EntityHomeWrapper1
         Cargador: prueba.root:0.0.0
         Origen de Código: /C:/OC4J 10.1.3.3/j2ee/home/application-deployments/prueba/MGU-1.0/deployment-cache.jar
         Configuración: <ejb> in wrappers
         Clase Dependiente: com.evermind.server.ejb.deployment.EntityBeanDescriptor
         Cargador: oc4j:10.1.3
         Origen de Código: /C:/OC4J 10.1.3.3/j2ee/home/lib/oc4j-internal.jar
         Configuración: <code-source> in META-INF/boot.xml in C:\OC4J 10.1.3.3\j2ee\home\oc4j.jar
    We have looked for information about the 'Bad version number' error, and we have recompile all our code with the JDK 1.5 (the same JDK for the OC4J). But we still have the error...
    Which may be the problem?...
    Thanks.

    The only thing you can do is to make sure that you recompile everything you're using.
    --olaf                                                                                                                                                                                           

  • Using J2EE EJB Container and Oracle 8.1.7

    I am trying to setup the J2EE EJB container to use and Oracle 8.1.7 database instead of Cloudscape. So far I have done the following
    0. Created the table for the Savings Account tutorial in the Oracle Database.
    1. Added the Classes12.jar (Oracle's latest JDBC thin drivers) to my CLASSPATH
    2. Under "Server Configuration" I added the standard/jdbc drivers value: "oracle.jdbc.driver.OracleDriver".
    3. Under "Server Configuration" I added the standard/datasource value: JNDI name "jdbc/Oracle" and JDBC URL "jdbc:oracle:thin:@10.1.1.254:1521:DEV".
    4. For the savings account tutorial, when deploying I specified "jdbc/Oracle" for the reference "jdbc/SavingsAccountDB".
    I have gotten this tutorial to work using the Cloudscape database. After I did the previous steps and tried to run the client, I get no valid driver available, unable to connect to Oracle.
    What else to I need to do?
    My setup is:
    Windows 2000 Professional
    J2EE (JDK 1.3.1)
    Oracle 8.1.7
    Thank you in advance.

    Exactly which classpath did you add the Oracle JDBC library jar to ?
    The thing that works for me is to have the following line in the file %J2EE_HOME%\bin\userconfig.bat
    set J2EE_CLASSPATH=D:\DownLoad\Oracle\classes12_01.zip;

  • Using DAO without J2EE/EJB

    Can I implement the DAO pattern in my 2-tiered application without using J2EE/EJB? My reason for using DAO is simply to insulate database changes from interface/business code and to make interface/business code easier to write.

    Sure, go ahead.

  • EJB Specification

    can anybody help me where can i get ejb specification? not documentation...

    u can follow the link:
    http://java.sun.com/products/ejb/docs.html
    http://www.comptechdoc.org/docs/kanti/ejb/ejbroles.html

  • Compliant J2EE/EJB class file packaging...

    Hi,
    I've just come across some commerical components which are packaged slightly strangely and I'd like to find out if their approach is J2EE compliant.
    The components are EJBs which are packed into several EJB module archives (.jars) inside a main application archive (.ear). The interesting thing is, inside each EJB module .jar, they have packaged the .class files into several ordinary .jar files and added those .jars into the EJB .jar, rather than simply adding the classes to the EJB .jar itself. My question is, is this compliant?
    Are application server classloaders suppsed to automatically open such embedded .jars and make the classes available to the container at runtime? I don't think so but I have been assured by the vendor in question that this is compliant (and runs in the J2EE 1.2 RI which I havn't tested).
    There are no directives, either in the J2EE deployment descriptors or .jar Manifests which can be used to indicate that the 'inner' .jar files should be unpacked. The Class-Path Manifest attribute can be used to point to other jars using a relative URI but I don't believe it can be used to point to .jars inside the referencing .jar. (In any case, this vendor isn't using a Class-Path attribute)
    Any thoughts appreciated!
    Regards,
    John.

    >
    Nesting .jar's has always been perfectly proper, It has? I've certainly never seen anything like this in my past java programming experience. Can you give me some examples or references to the J2SE or J2EE specifications that back up this assertion?
    I believe J2SE doesn't allow you to simply place different classes in different jars, then nest those jars inside each other and expect a standard ClassLoader to be able to load the classes from the correct location at runtime. Try it, you'll see that doesn't work. I can see nothing in the J2EE spec that says that a J2EE appserver has to go looking into these nested jars.
    why
    do you believe that ejb-jar do not support this ?Quite simply because there are no references to "nesting" jars in the specification, beyond
    a) nesting J2EE modules (.jar, .war and .rar files) inside J2EE application .ear files
    and
    b) nesting required libraries in "WEB-INF/lib" location of a .war file.
    Both of these cases are explicitly defined in the specification but I don't believe there is any support for "general" nesting or Jars.

  • How do I use the J2EE EJB container with the FULL version of Tomcat

    The version of Tomcat integrated in J2EE is really cut-down. I want to be able to run the standard Tomcat 4.0.1 to give the full JSP facilities, but I also want to be able to use EJBs from the J2EE.
    If I copy the j2ee.jar, j2ee-ri-svc.jar and home interface to the "lib" directory they do not appear to be loaded, as I cannot resolve the javax.ejb.EJBHome.class.
    If I copy the same library into the application's WEB-INF/lib directory then the naming jaxax.naming.InitialContext gives a context without the java:/comp/env entries.
    I do not want to use another EJB contrainer after having got used to deploying apps with J2EE.
    If anyone can help I would be greatful, and post a thanks message with duke dollars!
    Chris
    10 Duke Dollars available

    I have done it before and basically it is not that difficult, but in practice not that easy ;-)
    All you need to do is see Tomcat as a client to the EJBs. This means deploying the application in two parts: the webapp as a WAR to Tomcat 4.0.1, and the EJBs to J2EE. Both running and started independantly.
    This ofcourse means that the WAR file must have the stubs of the EJBs to be able to communicate and access to j2ee.jar to get the InitialContext.
    So:
    - compile the EJBs
    - create the EAR (containing only EJBs)
    - deploy the EAR
    - copy the stubs to the libs directory of the webapp
    - compile the webapp
    - create the WAR
    - deploy the WAR
    Off you go.
    Tom

  • Oracle and J2EE EJB

    Hi all,
    I am novice in the develpment of applications using EJB's. I have created the table and inserted the records in the oracle database using the J2EE where by the J2EE creates the table autometically. The application is working fine. But my main concern is that I am not able to access any records of this table when I give "select * from SportscarBeanTable" querry in the sql prompt of the oracle for which I get "no such table". But if I give the querry "Select table_name from user_tables", the table created by me is displayed. Can anybody clarify my doubt. Any help will be greatly appreciated.
    deepak

    Hi,
    Yes it is listing the table. The table is created by the J2EE server in the oracle database. Can u please specify the schema under which the J2EE server creates the tables in the oracle database.
    Thank you,
    deepak

  • J2ee  - Restarting specific server process

    hi,
    We have Central instance with 3 j2ee server processes running. One of the server process has issues, needs restart . I tried with SMICM and JCMON to restart only a specific server process. I could not try all options in production instance. Is it possible to restart only affected server process instead of entire j2ee server.?
    This is needed as users may be using other 2 server processes anytime.
    Visual admin does not show, this server process as it has issues.
    Thanks,
    Raj

    Hi Raj,
    You could restart a server process with JCMON.
    Choose local instance and then choose restart a process and enter the id of the server node that you want to restart.
    Regards,
    Ventsi Tsachev

  • J2EE-EJB-Deploying an Enterprise JavaBean-deployment failure

    I am unable to deploy a simple EJB application . I am using j2skee1.3.1 and J2SDK1.4.0
    The related files and error messages are reproduced.
    The java files and ear files are in d:\myjava\ejb
    class path is .;d:\j2sdkee1.3.1\lib\j2ee.jar;D:\forte_jdk\j2sdk1.4.0\lib;d:\myjava
    j2ee_home= d:\j2sdkee1.3.1
    java_home=D:\forte_jdk\j2sdk1.4.0
    path=%SYSTEMROOT%;%SYSTEMROOT%\command;c:;d:\j2sdkee1.3.1\bin;%SYSTEMROOT%\system32;%SYSTEMROOT%\system32\WBEM;C:\Program Files\Common Files\Adaptec Shared\System;D:\forte_jdk\j2sdk1.4.0\bin;d\j2sdkee1.3.1\javaservlets;d:\MSSQL7\BINN;D:\forte_jdk\j2sdk1.4.0\bdk1_1\beans\beanbox
    Can any one suggest a solution.
    ************calculatorHome**********
    import java.io.Serializable;
    import java.rmi.RemoteException;
    import javax.ejb.CreateException;
    import javax.ejb.EJBHome;
    public interface calculatorHome extends EJBHome
         calculator create() throws RemoteException, CreateException;
    ************calculator***************
    import javax.ejb.EJBObject;
    import java.rmi.RemoteException;
    public interface calculator extends EJBObject
         public double dollorToRs (double dollars) throws RemoteException;
    **********calculatorEJB***********************
    import java.rmi.RemoteException;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    public class calculatorEJB implements SessionBean
         public double dollarToRs (double dollars)
              return dollars * 48.15;
         public calculatorEJB() {}
         public void ejbCreate() {}
         public void ejbRemove() {}
         public void ejbActivate() {}
         public void ejbPassivate() {}
         public void setSessionContext (SessionContext sc) {}
    ***********************************descriptor*************
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
    <ejb-jar>
    <display-name>newcalculatorjar</display-name>
    <enterprise-beans>
    <session>
    <display-name>calculatorEJB</display-name>
    <ejb-name>calculatorEJB</ejb-name>
    <home>calculatorHome</home>
    <remote>calculator</remote>
    <ejb-class>calculatorEJB</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Bean</transaction-type>
    <security-identity>
    <description></description>
    <use-caller-identity></use-caller-identity>
    </security-identity>
    </session>
    </enterprise-beans>
    </ejb-jar>
    ***************************error message*****
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
    <ejb-jar>
    <display-name>newcalculatorjar</display-name>
    <enterprise-beans>
    <session>
    <display-name>calculatorEJB</display-name>
    <ejb-name>calculatorEJB</ejb-name>
    <home>calculatorHome</home>
    <remote>calculator</remote>
    <ejb-class>calculatorEJB</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Bean</transaction-type>
    <security-identity>
    <description></description>
    <use-caller-identity></use-caller-identity>
    </security-identity>
    </session>
    </enterprise-beans>
    </ejb-jar>
    STATIC VERIFICATION RESULTS
         NUMBER OF FAILURES/WARNINGS/ERRORS
         # of Failures : 3
    # of Warnings : 0
         # of Errors : 0
         RESULTS FOR EJB-RELATED TESTS
         FAILED TESTS :
         Test Name : tests.ejb.intf.remoteintf.RemoteInterfaceMatchMethodArgs
         Test Assertion : Remote interface business methods have matching method arguments test
         Test Description : For [ calculatorEJB ]
    For Remote Interface [ calculator ] method [ dollorToRs ]
    Error: No corresponding business method with matching arguments was found for method [ dollorToRs ].
         Test Name : tests.ejb.intf.remoteintf.RemoteInterfaceMatchMethodException
         Test Assertion : Remote interface business methods have matching method exceptions test
         Test Description : For Remote Interface [ calculator ] method [ dollorToRs ]
    Error: No corresponding business method with matching exceptions was found for method [ dollorToRs ].
         Test Name : tests.ejb.intf.remoteintf.RemoteInterfaceMatchMethodReturn
         Test Assertion : Remote interface business methods have matching method return type test
         Test Description : For [ calculatorEJB ]
    For Remote Interface [ calculator ] method [ dollorToRs ]
    Error: No corresponding business method with matching return type was found for method [ dollorToRs ].
    Thanks in advance.
    Nagarajan

    In EJB home you have -
    public double dollorToRs (double dollars) throwsIn EJB you have -
         public double dollarToRs (double dollars)There is a spelling difference in the function name

  • J2EE EJB stateless session bean lifecycle

    Hi all,
    I've developed a stateless session bean to manage starting/stopping a JCo server.
    What should I do in order to achieve these goals:
    1. The stateless session bean should be created when the SAP J2EE server is started.
    2. The stateless session bean may NEVER 'die'.
    Thanks,
    Jeroen

    hi
    good
    1-
    go through these links, which ll give you the idea how to crea the stateless bean.
    http://edocs.bea.com/wle/ejbsamp/stateles.htm
    http://www.sitepoint.com/print/implement-first-ejbs
    2-
    http://home.tiscali.nl/illuminate/scbcd/My%20SCBCDE%20Study%20Notes%20-%204%20Session%20Bean%20Lifecycle.htm
    thanks
    mrutyun^

  • What is the best way of integrating rules to a J2EE (EJB 3) application ?

    We are working in a J2EE(EJB3) project which we plan to validate business logic using rule engine(JBoss rule). What is the best way of integrating the rule engine to the application ?
    Does rule engine good for validating a large no of data volume ? (asserted as an objects)

    I don't see a big switch construct. How about trying the following:
    Call this method from your original method by passing the resultset obtained.
    public String[] convert(ResultSet rs) {
         int col = ((ResultSetMetaData) rs.getMetaData()).getColumnCount();
         String[] record = new String[col];
         int i=0;
         while(rs.next()) {
              if(rs.wasNull()) record[i] = new String();
              else record[i] = rs.getString(i);
              i++;
         return record;
    iDriZ

  • Does 8.1 sp3 support EJB Specification 2.1?

    More specifically does it support the Enterprise Bean Timer interface?

    John,
    To have timed callbacks in 8.1sp3 you could use JMS and send messages with birth time set, which can be consumed by a MDB, which inturn on reception of message invokes the callback method.
    WLS 8.1, JMS supports message birth times.
    This may not be the best way, but the simplest way to get it done.
    vasanthi ramesh

  • J2ee - EJB

    Hi.. i hav my session beans deployed in my J2ee1.4 server.. and i have a standalone CORBA client.. i dont know how to access the EJB's from the CORBA client.. Pls help!!

    I think the following links wil help you
    http://java.sun.com/j2se/1.4.2/docs/guide/rmi-iiop/interop.html
    http://www.javaworld.com/javaworld/jw-03-2002/jw-0329-corba.html
    http://192.87.31.188/docs/easpg/easpg49.htm

  • EJB Specification question

    In the EJB Specs that I have been working with (1.1), whenever you make an entity bean, you have to specify the PK ID for the bean you wish to create. This ID goes into the database for the Server to be able to persist / find your bean. My question is:
    Why do I have to specify the PK ID when I create a bean? Why can't I just call ejbCreate() and have it return an ID to me? So the Server and the Database could handle making sure that it is not a duplicate key. I find it creates more work than necessary that I have to figure out what PK ID is not taken yet and create that one, when if I used an IDENTITY field in a database, that could easily do it for me.
    Anyone know why they chose to FORCE developers / (and Server admins not) to choose the PK ID? Why not give us the option of either having the server do it and return the ID, or us choosing it?
    Anyone have thoughts on this?
    Robert

    Hi,
    Although it would have been a lot easier, they
    propably didn't define this in the EJB specs this way
    to stay compatible with all databases. Not all
    databases support the IDENTITY field. I remember there
    were some interesting discussions about other ways to
    define a PK on www.theserverside.com.Yeah, but that's why they could give you a choice, so that if you didn't want to do it, or your db didn't support it, you wouldn't have to do that.

Maybe you are looking for

  • XDP data transfer not working

    Our process involves filling out a submission form, sending the data to the approval form, and then viewing that approval form. Essentially a simple submission and approval workflow. When we export the XML of the approval form to see what data was pa

  • HT2589 Im in Kuwait and i cant Get my itunes to except my account info

    im from the US and im in Kuwait right now and i cant get my itunes to accept my account info

  • Column length of a LONG RAW column

    How to find out the column length of a LONG RAW column, to compute the average row size in Oracle 7.3.4 Thanks.

  • 11g Oracle ADF Certification

    Hi, can anyone help me to know, is there any certification is available for 11g Oracle ADF developers like SCJP for java developers. If available pls guide me what is the procedure to write the exam, exam fees, syllabus, eligibility. Thanks, Sankari

  • 10.7.1 did not fix any problems.

    The current update did not fix facetime at all. I'm still not able to use facetime.