Version Consistency EJB

Hi
i'm trying to use this Versioning EJB so that i can use the caching in a Optimistic fashion
But i have some questions
I have a SessionFacade followed by and CMP kind of architecture
Imagine a client ask for a CMP to the SessionBean, i return a DTO with this information. Then the client wants to do an Update, he sends it to the SessionBean, that will look for the CMP (doing a findByPrimaryKey) at this time, all my information could have been compromised, because the information i got from the Database and the information i have on the DTO is potentially different.
Using version consistency i cant access the Version Column, so i can't verify if the version is correct when the SessionBean get the CMP (to do the update)
Version consistency will be good for me because i'm in a clustered enviornment, so i know that if someone in the other server changed something in the Database, the CMP will not allow me to update the info using and old bean.
So i need this Version Consistency
I'm faced with an option of having Version Consistency for Clustered Enviornment, and a second version column so that i can check consistency in the call between client and CMP
But this doesn't make any sense
Any thoughts?
Thanks

Meaning that we will load always the same bean if we don't create a new one.
And if we save it once, we will never be able to save it again, because we will
have a incorrect version numberWe update the version of the bean in the cache also. So, the database and the cache are always in sync when you update the bean.

Similar Messages

  • What is the latest version of EJB ?

    a) what is the latest version of EJB ? and
    b) what was the version prior to the latest version ?
    Any good book suggestion for option - b

    The latest version is EJB 3.0, which is part of Java EE 5.
    The spec can be found here :
    http://www.jcp.org/en/jsr/detail?id=220
    There's EJB 3.0 coverage in the Java EE 5 tutorial :
    http://java.sun.com/javaee/5/docs/tutorial/doc/
    You can find additional resources here :
    https://glassfish.dev.java.net/javaee5/ejb/
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Production version consistency check

    Hi,
    I am facing an issue in which i have created a BOM and a master recipe group. The production version is created and all the things are maintained properly so that consistency check shows green light i.e. everything is fine.
    Then i delete the same material from recipe group and then do the consistency check then it turns to yellow since recipe group is missing.
    But when i reassign the material to the recipe group and do the consistency check then also it remains in yellow and gives 2 line items in check result :-
    one with message that task list exists.
    and another with missing task list /material assisgnment .(in this the todate is the date on which i deleted the assignment)
    My confusion is that after reassignment it should turn back to green but it is not.
    Can you please help on this.
    Thanks
    Rohit

    Hi Rohit,
    Check Production Version Valid from date and also Date from when you have reassign that material in Master Recipe again.Both should be match.
    Regards,
    Dhaval

  • What is @version in EJB 3.0 ?

    Hi
    Thank you for reading my post.
    I need some explanations about @version .
    when it increment?
    why we should use it?
    is it manedatory?
    Thanks

    No, EJB 3.0 is only implemented within a product supporting Java EE 5.
    EJB 2.1 is required within J2EE 1.4 implementations.
    since we're on the topic ...
    EJB 2.0/J2EE 1.3
    EJB 1.1/J2EE 1.2
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                       

  • EJB JAR Versioning

    I am using jdk version 1.3.1_02.
    How I can know which version of EJB JAR I need to use (1.1, 2.0, 2.1) sam for JTA JAR file.
    I looked in the JAR's documents and I couldn't find a word about versioning comptability.
    Thank you.

    The J2EE version (or appropriate sub-set) must be compatible with what the application server supports - the JDK version does not (necessarily) have anything to do with it.

  • EJB versioning information

    I am writing a report on versioning in EJB 3.1 but cannot find any more accurate information on the topic more than 'its managed by JNDI and is rarely used' or that is more than 5 years old.
    Does anyone have any pointers to a more accurate and current source of information of versioning handling in EJB 3.1? Or why there is so little information about it.

    858625 wrote:
    Sorry for being unclear.
    Component versioning deployment. To handle version dependencies between objects.
    Here it is detailed how it is done in .net for example: http://msdn.microsoft.com/en-us/library/51ket42z%28v=VS.100%29.aspx
    Class versioning is a core Java feature and should not be discussed together with EJBs.
    See the JVM spec for information about class versioning. It actually has nothing to do with Java the language.

  • Very simple EJB 3.0 MDB but I get NullPointerException

    I tried to create a very simple EJB 3.0 Message Driven Bean in JDeveloper 10.1.3.2 as follows:
    Message Driven Bean Class:
    import javax.ejb.MessageDriven;
    import javax.jms.Message;
    import javax.jms.MessageListener;
    @MessageDriven(mappedName="MDBQueue")
    public class MDB implements MessageListener {
    public void onMessage(Message message) {
    System.out.println("Got message!");
    Application Client:
    import javax.annotation.Resource;
    import javax.jms.*;
    public class MDBAppClient {
    @Resource(mappedName="MDBQueueConnectionFactory")
    private static QueueConnectionFactory queueCF;
    @Resource(mappedName="MDBQueue")
    private static Queue mdbQueue;
    public static void main(String args[]) {
    try {
    QueueConnection queueCon = queueCF.createQueueConnection();
    QueueSession queueSession = queueCon.createQueueSession
    (false, Session.AUTO_ACKNOWLEDGE);
    QueueSender queueSender = queueSession.createSender(null);
    TextMessage msg = queueSession.createTextMessage("hello");
    queueSender.send(mdbQueue, msg);
    System.out.println("Sent message to MDB");
    queueCon.close();
    } catch(Exception e) {
    e.printStackTrace();
    But I get the following error:
    java.lang.NullPointerException
         at model.MDBAppClient.main(MDBAppClient.java:17)
    I read similar problem in the this thread:
    Re: message driven bean on ejb 3.0 does not work
    some one said that the version in ejb-jar.xml must be changed from 2.1 to 3.0
    but in this case there is no ejb-jar.xml.
    ( I have other cases with ejb-jar.xml file but I can't change the version in ejb-jar.xml)
    the version in web.xml is 2.4 but it not accept any value except 2.4 and an error occur when I tried to change it to 3.0
    please can you tell me why I get NullPointerException and how can I allow EJB 3.0 MDB and JMS to work in JDeveloper

    Note that you can't run MDBs in the embedded OC4J in JDeveloper - try deploying to a stand-alone install of OC4J and see if it works there.

  • OC4J 9.0.3 and EJB 1.1 deployments???

    I can not deploy my ejb1.1 beans on 9.0.3 container.
    OC4J crashes with an XML parse error as a null pointer exception.
    If I remove my O-R mappings from my orion-ejb-jar.xml file, the container starts up ok (app wont run as it needs the mappings)
    9.0.3 docs claim I should be able to use my 1.1 ejb in this ejb 2.0 container.
    Solaris release notes for 9.0.3 claim I must migrate to ejb2.0
    Someone else posted this same question but got no replies.
    Anyone else deployed ejb1.1 with OR mappings in 9.0.3 successfully yet?
    thanks

    I have tried migrating to an ejb2.0 set of beans and ejb-jar.xml file.
    With no <query> tags installed for my finders I notice that a typical finder produces this:
    <!-- Generated SQL: "select Isp.isp_Id from Isp -->
    This is vastly different from the 1.1 orion-ejb-jar.xml which would list ALL column names in the finder - hence how am I going to do a findAll? The currently generated sql is way off. Deployment of the "ormap" demo also shows a lack of column names in the generated SQL finder methods in orion-ejb-jar.xml.
    Further, as soon as I introduce the query in the 2.0 version of ejb-jar.xml, the container dies with a null pointer exception. Removing this from the ejb-jar and bean deploys. Useless, cause theres no finders though.
    Also, attempts to add to the <finder-method query=...> tag yield container crashes with null pointers too.
    This is not very robust to say the least. Can you provide names of jar files that would cause such exceptions?
    When NO query tag is inserted in the ejb-jar file, attempts to run a sample client using findByPrimaryKey return successfully but use of findAll causes timeouts similar to whats described in
    "finders giving "timeout expired waiting for an instance" after 0, 1, or 2 calls" in this same forum.
    Heres the query out of the ejb-jar.xml file...
    <query>
    <query-method>
    <method-name>findAll</method-name>
    <method-params></method-params>
    </query-method>
    <ejb-ql>
    SELECT OBJECT(o) from IspTb o
    </ejb-ql>
    </query>
    IspTb is the <abstract-schema-name> Tables exist in db.
    The full error...which prevents deployment of the ejbs and hence no rewrite of the orion-ejb-jar file.
    =========
    10/23/02 1:54 PM: javax.ejb.EJBException: nested exception is: java.lang.NullPointerException
    10/23/02 1:54 PM: java.lang.NullPointerException
    10/23/02 1:54 PM: at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
    10/23/02 1:54 PM: at java.lang.ClassLoader.loadClass(ClassLoader.java:287)
    10/23/02 1:54 PM: at com.evermind.naming.ContextClassLoader.loadClass(ContextClassLoader.java:135)
    10/23/02 1:54 PM: at java.lang.ClassLoader.loadClass(ClassLoader.java:287)
    10/23/02 1:54 PM: at com.evermind.naming.ContextClassLoader.loadClass(ContextClassLoader.java:135)
    10/23/02 1:54 PM: at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.getClass(PersistenceDescriptor.java:767)
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.getStateClass(PersistenceDescriptor.java:753)
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.getCMPFieldType(PersistenceDescriptor.java:1302)
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.initializeFieldInfo(PersistenceDescriptor.java:1052)
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.getPersistentFieldInfo(PersistenceDescriptor.java:805)
    10/23/02 1:54 PM: at com.sun.ejb.sqlgen.SQLGenerator.<init>(SQLGenerator.java:151)
    10/23/02 1:54 PM: at com.sun.ejb.sqlgen.SQLGenerator.generateSQL(SQLGenerator.java:360)
    10/23/02 1:54 PM: at com.sun.ejb.sqlgen.SQLGenerator.generateSQL(SQLGenerator.java:309)
    10/23/02 1:54 PM: at com.evermind.server.ejb.deployment.EJBPackage.translateEjbqlQeries(EJBPackage.java:2100)
    10/23/02 1:54 PM: at com.evermind.server.ejb.compilation.Compilation.translateEjbqlQeries(Compilation.java:140)
    10/23/02 1:54 PM: at com.evermind.server.ejb.compilation.Compilation.compile(Compilation.java:178)
    10/23/02 1:54 PM: at com.evermind.server.ejb.EJBContainer.postInit(EJBContainer.java:551)
    10/23/02 1:54 PM: at com.evermind.server.Application.postInit(Application.java:431)
    10/23/02 1:54 PM: at com.evermind.server.Application.setConfig(Application.java:136)
    10/23/02 1:54 PM: at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:1635)
    10/23/02 1:54 PM: at com.evermind.server.ApplicationServer.initializeApplications(ApplicationServer.java:1585)
    10/23/02 1:54 PM: at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1240)
    10/23/02 1:54 PM: at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:93)
    10/23/02 1:54 PM: at java.lang.Thread.run(Thread.java:479)
    10/23/02 1:54 PM: javax.ejb.EJBException: nested exception is: java.lang.NullPointerException
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.getClass(PersistenceDescriptor.java:770)
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.getStateClass(PersistenceDescriptor.java:753)
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.getCMPFieldType(PersistenceDescriptor.java:1302)
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.initializeFieldInfo(PersistenceDescriptor.java:1052)
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.getPersistentFieldInfo(PersistenceDescriptor.java:805)
    10/23/02 1:54 PM: at com.sun.ejb.sqlgen.SQLGenerator.<init>(SQLGenerator.java:151)
    10/23/02 1:54 PM: at com.sun.ejb.sqlgen.SQLGenerator.generateSQL(SQLGenerator.java:360)
    10/23/02 1:54 PM: at com.sun.ejb.sqlgen.SQLGenerator.generateSQL(SQLGenerator.java:309)
    10/23/02 1:54 PM: at com.evermind.server.ejb.deployment.EJBPackage.translateEjbqlQeries(EJBPackage.java:2100)
    10/23/02 1:54 PM: at com.evermind.server.ejb.compilation.Compilation.translateEjbqlQeries(Compilation.java:140)
    10/23/02 1:54 PM: at com.evermind.server.ejb.compilation.Compilation.compile(Compilation.java:178)
    10/23/02 1:54 PM: at com.evermind.server.ejb.EJBContainer.postInit(EJBContainer.java:551)
    10/23/02 1:54 PM: at com.evermind.server.Application.postInit(Application.java:431)
    10/23/02 1:54 PM: at com.evermind.server.Application.setConfig(Application.java:136)
    10/23/02 1:54 PM: at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:1635)
    10/23/02 1:54 PM: at com.evermind.server.ApplicationServer.initializeApplications(ApplicationServer.java:1585)
    10/23/02 1:54 PM: at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1240)
    10/23/02 1:54 PM: at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:93)
    10/23/02 1:54 PM: at java.lang.Thread.run(Thread.java:479)

  • Error when trying to start EJB Server

    Hi,
    I am new to EJB's and am following the tutorial on ejbtut.com. I followed the tutorial and created the EmployeesEJB.jar file and placed the appropriate code in the ejb.ini file to deploy it. But when i start the EJB server i get the following. Can anyone please help me tackle this problem.
    Heres what happens when i start the server:::::::::::
    file: C:\Blazix\Ejblog.log
    Blazix EJB Server 1.2
    Copyright (C) Desiderata Software, 2001-2002
    All rights reserved
    Configuration file: C:\Blazix\ejb.ini
    JRMP version
    Deploying EJB-Home class "employees.EmployeesHome" at JNDI name "Employees"
    Evaluation license
    java.rmi.ServerException: Server RemoteException; nested exception is:
         java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
         java.lang.ClassNotFoundException: desisoft.ejb.server.EjbServerJRMP_Stub
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
         java.lang.ClassNotFoundException: desisoft.ejb.server.EjbServerJRMP_Stub
    java.lang.ClassNotFoundException: desisoft.ejb.server.EjbServerJRMP_Stub
         at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
         at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
         at sun.rmi.server.UnicastRef.invoke(Unknown Source)
         at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
         at java.rmi.Naming.rebind(Unknown Source)
         at desisoft.ejb.server.EjbServerJRMP.serverMain(EjbServerJRMP.java:329)
         at desisoft.ejb.server.EjbServer.main(EjbServer.java:803)
    Looking at the error it seems as if its looking for the EJBServer's stub file. The tutorial didn't mention abt creating any kind of stub file, so can someone please tell me what am missing here.
    Thanks in advance

    Generate the stubs and skeletons for your EJB.This you can do by generating deployment code in most of the IDEs.
    Hope this helps you.

  • JAVA Proxy :: Exception in ejb-jar.xml in NWDS

    Hi All
    I am getting exception while Importing (Inbound) JAVA Proxy ZIP file in NWDS, ejb-jar.xml shows the red cross & when I double click on it got following error -->
    The content of element type "ejb-jar" is incomplete, it must match "(description?,display-name?,small-icon?,large-icon?,enterprise-beans,relationships?,assembly-descriptor?,ejb-client-jar?)".
    I already add the following JAR files in class-path -->
    aii_proxy_xirt.jar
    aii_msg_runtime.jar
    aii_utilxi_misc.jar
    guidgenerator.jar
    One different thing I also notice is that after adding these JAR files in classpath I am not getting my Inbound Interface BEAN under EJB candidates.
    Also nothing is visible under ejbModule usually it shows 4 JAVA files & one template file.
    As a solution I tried searching in google & forum for above exception, most threads suggest to add the Beans to xml files but I am not getting my interface Bean under EJB candidates.
    I also tried reloading all the external JAR files again from System but still same issue.
    Also within the same NWDS one another version of EJB is working fine but I worked on it 6months back, I tried copy its contents to ejb-jar.xml source code but then also nothing happens.
    I am using NWDS Version: 7.0.10
    Can you pls. suggest & let me know what further information I can provide from my side which can help you to investigate it.
    Regards
    Lalit

    hi,
    Your are using server java proxy.
    You can use some other jar files apart from what you are using,.
    ejb20.jar
    exception.jar
    sapj2eeclient.jar
    and after importing your zip file (create a ejb project first ,then add the zar files and then click on the ejbModule and then import your zip file ) close and open your project.
    Do not directly click on ejb-jar.xml.Click on ejbModule and import the .zip file.
    then save your .template file in ejbModule as a .java project.
    then there should not be any error.
    you can refer
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d06315a6-e66e-2910-039c-ba8bbbd23702
    regards,
    ujjwal kumar

  • Multiple ejb applications deployment

    Hi,I want to know whether it is possible to deploy ejb 2.0 and ejb 3.0 applications in the same server?If I deploy it in the same server,will multiple differnet versions od ejb create ay problems?

    Raspunz wrote:
    Hi,I want to know whether it is possible to deploy ejb 2.0 and ejb 3.0 applications in the same server?yes
    If I deploy it in the same server,will multiple differnet versions od ejb create ay problems?no

  • EJB deployment problem --New remote interface class files are not loaded

    Hi, I face a problem while deploying an ear file in oc4j. I basically get some problems like the method in the remote interface is not implemented in the EJB class. But the implementation is actually available in the EJB class.
    We get this problem when we actually change the signature of the EJB remote methods. The new methods are not referenced by oc4j. Only the old version of remote interface is referenced by oc4j. But the latest version of EJB class is taken. I am using 9.0.3 version of the oc4j. Could you pls help me regarding this problem ?
    Regards
    Solomon

    I have found the solution :-)
    You must add to the ejbCreate() method of the bean class throws javax.ejb.CreateException

  • CMP EJB in 1.1/1.2..., mapping problems

    Hello,
    I'm a little bit confused by all these different EJB specifications and products...
    I want to use CMP EJB, because as far as I understand this topic, the container should do a lot of work for me (transaction management, connection pooling) and all tutorials tell me to prefer CMP ;-)
    Now I've got a Java class (to became my CMP EJB) like this:
    class doc {
    Descriptor descr;
    String body;
    and another class:
    class descriptor {
    int id;
    String title;
    My database contains two tables for both classes:
    table descr:
    id int (primary key);
    title varchar;
    table doc:
    fk_descr int; // foreign key to descr
    body varchar;
    Is it possible to make a CMP EJB using these two tables and using a Descriptor object? Which versions of EJB can handle this? Do you have any expirience with that?
    All examples I've read are always using only one table and classes containing only basic types like int, String.
    Thank you,
    Jens

    What you've described is a 1-1 relationship between two classes, which is not supported by CMP until EJB 2.0.
    -Peris

  • Problem in getting Updated EJB methods in JSC for a Same Project

    I'm Using Sun Studio Enterprise for developing EJB sets.After that i'm importing the EJB set in to JSC & using it my Project.
    If i need to add some more business methods/edit the business method i'm able to do that in the Sun Enterprise IDE.After editing the EJB ,redeploying & reimporting to JSC i couldn't get the updated version of EJB in my Current Project.
    We could be able to get the updated EJBs,if we are using it in a new project other than using it in the Previous one.
    It's being a great problem for me.Vat shall i do for this problem?Please help me,a project is in Pending stage because of this problem.
    Regards
    Kajanan

    Hi MWH@Keystroke,
    Thanks for your consideration of my problem.I also use an EJB layer built in Sun Enterprise for the backend to my Creator-based web application.My Current problem is getting the updated EJB sets to my current project.
    For Ex:
    If i add a new Business method called doSomething( ),then i should be able to get that method in JSC using FinalFacadeRemoteClient1.doSomething().
    But after typing FinalFacadeRemoteClient. , doSomething() method is not displaying.
    If i use that in a new project [Previously not used Same Session Facades]all the updated EJB business methodss are coming.I want to use updated EJBs in the project i'm already working.
    Regards
    Kajanan

  • EJB Session Bean + POJO + JPA ?

    Hi all,
    I have a design consideration regarding the use of ejb's in distributed applications.
    With older versions of ejb specification one would prefer using ejb's to do both the business logic (session beans) and data access logic (entity)
    Now with the advent of ejb 3.0, one can replace the entity beans with the new JPA api with Hibernate/TopLink/Kodo as the persistance provider.
    Now my question is:
    Should i place all my business logic (like calling the respective dao objects etc) in session beans or can this be implemented in POJOs?
    What are the advantage, disadvantage in both these aspects?
    This is a burning question for which i'm looking for an answer.
    Kindly help me.
    Thanks in advance,
    James

    they are both right as they both work. Easy huh?
    You might argue that if you have to set a lot of fields, use the entity as otherwise you get a method with a gigantic amount of parameters.

Maybe you are looking for

  • Problem in uploading a file

    Hi All, I did one application on file upload using the tutorial given in the ****************. But i am unable to run my application due to the function module 'HR_KR_XSTRING_TO_STRING' that does not exist.Can anybody plz tell me the name of the func

  • Movie playback, frame skipping

    hi, when I play avi movie, it looks like one frame is flipped or in wrong order. It happens randomly, but more often with high cpu usage.

  • Include the Journal entry created in Incoming Payments PLD

    Hello Experts!!! Is there a way to include the journal entry created in the Incoming Payments PLD?

  • Browser closing when opening PDF output in Apps

    Hello, When opening the concurrent request/report output (for PDF output), the browser just closes. The PDF output were generated thru XML Publisher (reports converted in XML Publisher - rtf). PDF is defined in the Viewer Options/ System Options(View

  • Number of Member ID is more than 65535 in a user defined Product Dim

    HI Friends I am in a BPC 7.0 MS Version  PLanning  Implementation. The Number of MEMBER ID'S in the PRODUCT DIMENSION  which is  USER DEFINED IS MORE THAN 65535 ROWS. Can you please suggest me how can i handle the situation. In the Sales Planning i a