Container-managed persistence Entity bean

WE use a container-managed persistence Entity bean. To handle the state synchronization between the object & the database, what must WE do?
Thanks in Advance

That's the container's job. You can use the commit option A/B/C to control how the DB and objects are synchronized.
-Scott
http://www.swiftradius.com

Similar Messages

  • Container Managed Persistence entity bean relationship fields

    I want to ask something that until now still confuse. Did Relationship fields in Container Managed Persistence entity beans declare , inside Database table or only Persistence fields .
    If Relationship fields not declare inside database table ,how if SQL calls the relationship fields between related entity bean.
    did container handle this task.
    example: I have 2 entity bean with CMP(Container Managed Persistence)version 2.0
    call Player and Team. every entity bean have own relationship fields and persistence fields.
    player has playerId(primary key),name,position,age persistence fields and teams is relationship fields.
    team has teamId(primary key),name,city and players is relationship fields.
    I know that all persistence fields is declare in own database table but how about relationship fields.
    can you tellme, How SQL calls can access relationship fields if relatiosnship fields is not declare in database table.
    I use J2EE RI SDK version 1.3
    and deploytool .
    thank's .

    thank's for your reply .Now I have another problem
    I use J2EE RI from java.sun .I try to follow example in j2eetutorial about CMP Example call RosterApp.ear .
    I dont'change anything code inside RosterApp.ear but when I deploy and runclient command thereis syntax error :
    java.rmi.ServerException: Remote exception occured in server thread :nested exception is java.rmi.ServerException :exception thrown from bean :nested exception is : java.ejb.EJBException :nested exception is :java.sql.SQLException :syntax error or access violation ,message from server: "you have an error in SQL syntax near "
    "leagueBeanTable" WHERE "leagueId" = 'L1' at line 1
    in example ,RosterApp.ear use Cloudscape database ,but I try to use Mysql database for RosterApp.ear ,is there any different syntax SQL from Cloudscape to Mysql .
    if like that ,so I must edit first SQL calls from Cloudscape to MYSQL . I think because relationship fields is for entity beans only ,so how if mysql database want to access foreign key another table because foreign key isn't declare in databse table.
    example : I have 3 entity bean call player, team, league .
    1. PlayerEJB have persistence fields name, position, playerId(primary key), cmr fields is teams
    2. TeamEJB have persistence fields name, city, teamId (primary key) , cmr fields is players and leagues .
    3. LeagueEJB have persistence fields name ,sport, leagueId(primary key), cmr fields is teams
    so table is
    PlayerEJB <--->TeamEJB<--->LeagueEJB
    Player have some finder method call findBySport(String Sport) .
    because Sport is persistence fields for LeagueEJB
    so PlayerEJB must traverse TeamEJB first before LeagueEJB
    EJB QL : SELECT distinct object(p) FROM Player (p) IN (p.teams) AS t
    WHERE t.league.sport = ?1
    I know that Container will translates EJB QL to SQL calls ,but default is only for cloudscape database and I use for MYsql .
    so can you helpme how to query method findBySport(String sport) to Mysql calls .
    thereis no foreign key between table in database table there is only Relationship fields in entity bean.

  • Container-managed persistence application problem

    I worked out a container-manager persistence entity bean application. Everything is fine until I run the client. When I ran the client, I got the following exception from the server side when I turned on "j2ee -verbose":
    "Exception in thread "RequestProcessor[20]" org.omg.CORBA.BAD_PARAM: CourseBean_P
    M_EJBLocalObjectImpl minor code: 1330446342 completed: Maybe
    at com.sun.corba.ee.internal.orbutil.ORBUtility.throwNotSerializableForC
    orba(ORBUtility.java:660)
    at com.sun.corba.ee.internal.iiop.CDROutputStream_1_0.write_abstract_int
    erface(CDROutputStream_1_0.java:631)
    at com.sun.corba.ee.internal.iiop.CDROutputStream.write_abstract_interfa
    ce(CDROutputStream.java:281)
    at com.sun.corba.ee.internal.javax.rmi.CORBA.Util.writeAbstractObject(Ut
    il.java:145)
    at javax.rmi.CORBA.Util.writeAbstractObject(Util.java:128)
    at com.sun.corba.se.internal.io.IIOPOutputStream.writeObjectDelegate(IIO
    POutputStream.java:99)
    at com.sun.corba.se.internal.io.IIOPOutputStream.writeObjectOverride(IIO
    POutputStream.java:106)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:271)
    at java.util.ArrayList.writeObject(ArrayList.java:513)
    at com.sun.corba.se.internal.io.IIOPOutputStream.writeObject(Native Meth
    od)
    at com.sun.corba.se.internal.io.IIOPOutputStream.invokeObjectWriter(IIOP
    OutputStream.java:525)
    at com.sun.corba.se.internal.io.IIOPOutputStream.outputObject(IIOPOutput
    Stream.java:492)
    at com.sun.corba.se.internal.io.IIOPOutputStream.simpleWriteObject(IIOPO
    utputStream.java:125)
    at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValueInternal(Valu
    eHandlerImpl.java:134)
    at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValue(ValueHandler
    Impl.java:114)
    at com.sun.corba.ee.internal.iiop.CDROutputStream_1_0.write_value(CDROut
    putStream_1_0.java:1049)
    at com.sun.corba.ee.internal.iiop.CDROutputStream_1_0.write_value(CDROut
    putStream_1_0.java:638)
    at com.sun.corba.ee.internal.iiop.CDROutputStream.write_value(CDROutputS
    tream.java:268)
    at _RegisterBean_EJBObjectImpl_Tie._invoke(Unknown Source)
    at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatchToServant(Ge
    nericPOAServerSC.java:519)
    at com.sun.corba.ee.internal.POA.GenericPOAServerSC.internalDispatch(Gen
    ericPOAServerSC.java:204)
    at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatch(GenericPOAS
    erverSC.java:112)
    at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:273)
    at com.sun.corba.ee.internal.iiop.RequestProcessor.process(RequestProces
    sor.java:84)
    at com.sun.corba.ee.internal.orbutil.ThreadPool$PooledThread.run(ThreadP
    ool.java:99)
    Anybody has any insight in this. I checked the appliation using the verification tool, it shows no problem at all. I am really out of idea!
    Thanks a lot!

    send me your contact info and i think i can help.
    my email is : [email protected]
    In addition I believe ssniazi is in violation of the conduct code of this website because ssniazi is requesting information which will be used by a business entity without telling the users that it will be used in that way. And I expect that Oracle itself would frown on such activities.
    2.3 You agree that You will not use the Website to:...(g) collect or store personal data about other users unless specifically authorized by such users.

  • Bean or Container Managed Persistence

    Hi,
    I've been reading up on the Sun J2EE tutorial. One of the topics there is bean or container managed persistence. It states that container managed is easier for developers and allows for more portability. The class codes are much smaller compared to bean managed and developers need not worry about database queries.
    Can anyone share their experiences on this? Any 'Real World' advantages and disadvantages? Is there a guideline I can follow when to use bean or container managed persistence?
    Thanks,
    -Ray

    That seems like an obvious flaw. So why was it even considered in the
    J2EE framework? I mean wouldn't the J2EE architects immediately realize
    that? Just doesn't make sense to me why there's even a tutorial or books
    for it. What does it suppose to solve then??I know what you mean... again, I think they thought it looked good on paper.
    And it gets worse...
    Before you use Entity Beans you must be absolutely sure that there will never be another app that accesses the underlying table that doesnt use the EntityBean to do it... For example a C++ App that accesses the tables directly... otherwise you have to set a flag in the App Server that states that basically every time a property on an EntityBean is read the Bean will have to RE-READ the beans state from the database!!
    Some things look really good, from an OO perspective, but dont work really well in reality. Sure Entity Beans look really good in the example program in the tutorial, but what happens when you multiply the number of entity beans by 1000, 100,000, or more? Just think of the CPU, and Memory overhead for instantiating all those objects!
    There are people out there who believe that using Stored Procedures is a no-no because in their minds it puts "Business Logic" on the database and not the App Server...To this I say... BUNK... Ive seen several instances where by simply moving a set of queries from the App Server to a stored procedure on the database, allowed for a 10-20 times performance gain because of the elimination of network IO. In one instance I saw a query go from 3 hours execution time on the App Server to under 10 minutes on the database... But stored procedures arent OO...
    So IMHO before you use EntityBeans at all... be absolutely sure you understand all of the ins-and-outs of doing so.

  • Bean-Managed vs. Container-Managed Persistence

    Hello,
    I would like the real world skinny on bean-managed persistence vs. container-managed persistence. I have heard the bean-managed offers higher scalability and performance, while container-managed offers simplicity but with a cost. Can someone give me some perspective?
    Thanks,
    Rob Miller

    Wrong forum, but I guess if you are new to java it could be argued that anything goes...
    General rule:
    use CMP if you don't have worries about speed or legacy systems.
    use BMP if you need to control the persistence and/or want to connect to legacy host systems. BMP allows you to set up caching and transaction handlers to handle the presistence in a manner more suited to your needs.

  • About Container-managed Transactions and Bean-managed Transactions

    as the document of weblogic7.0 describe the differents of Container-managed
              Transactions and Bean-managed Transactions,and in the document,It tell us
              details of using Bean-managed Transactions,such as \:
              import javax.naming.*;import javax.transaction.UserTransaction;.....
              import java.sql.*;import java.util.*;
              UserTransaction tx = (UserTransaction)
              ctx.lookup("javax.transaction.UserTransaction");tx.begin();
              tx.commit() //or tx.rollback
              but how to use Container-managed Transactions?
              what is EJB's deployment descriptor? can someone tell me?
              i wonder someone will show me an example of how to use Container-managed
              Transactions.
              thanks
              fish
              

    Many if not all of the WLS EJB examples use container-managed
              transactions. That's a good place to start.
              I'd also recommend that you pick up a decent EJB book. There's several
              on the market right now.
              -- Rob
              fish wrote:
              > <ejb-jar>
              > <enterprise-beans>
              > <session>
              > <ejb-name>testbean</ejb-name>
              > <home>test.test.TestHome</home>
              > <remote>test.test.Test</remote>
              > <ejb-class>test.test.TestBean</ejb-class>
              > <session-type>Stateful</session-type>
              > <transaction-type>Container</transaction-type>
              > </session>
              > </enterprise-beans>
              >
              > <assembly-descriptor>
              > <container-transaction>
              > <method>
              > <ejb-name>EmployeeRecord</ejb-name>
              > <method-name>*</method-name>
              > </method>
              > <trans-attribute>Required</trans-attribute>
              > </container-transaction>
              > </assembly-descriptor>
              > </ejb-jar>
              > ----------------------------------------------
              > seems i have to write ejb-jar.xml like this,am i right?
              > what about <ejb-client-jar>? is it needed in this xml file?
              >
              > thanks
              >
              > fish
              >
              >
              

  • Accessing collection field in container managed persistence bean

    Hello!
    How can i get 1:m relatioship, collection fields value?
    What is the purpose of ejbSelect-method, in bean business class?

    Please ask your EJB questions within the Enterprise JavaBeans section of this forum.
    The ejbSelect Method is a query method (like the finder mehtod) but it is not directly exposed to the client in the home interfacce or component interface. Rather, ejbSelect() is used internally within an entity bean as a helper method to accesss a storage. ejbSelect() is useful when you have entity beans in relationships with external data, such as other entity beans.
    look at http://www.theserverside.com/articles/content/ApplyingEJB/matena8.pdf for an example

  • Question on Persistence (Entity Beans, Hibernate, JDBC)

    Hi everybody!
    Until now, I have read a lot about persistence in the J2EE-sector, but I am still confused about which technology to used in my case.
    I hope, that maybe you can give me some hints, by telling me which technology is good or bad regarding my requirements:
    I want to build a customer- and order-management system fullfilling the following requirements:
    1. The client is a Java application, the server is a JBOSS 4.0.1
    2. The databasa scheme exists already and I'm not allowed to change it.
    Some data, that logically belongs together and which shall be presented together to the client is distributed over 2 database tables.
    3. The user cannot just create new and view data, but will also edit existing data quite often.
    4. The user can assign products to an order. Often, there will be more than 1000 products assigned to an order, which will be presented to the user as a table (e.g. JTable). The user can then edit each cell of that 1000-row table, which of course will lead to an update in the db.
    5. The user can also assign customers to a specific role in an order-process. On the other hand, each customer can make many orders.
    So, we have a n:m relation here with the db-tables Customer, Order, OrderCustomer.
    6. A complex search functionality has to be implemented, where the db-query is created dynamically at runtime.
    7. The application is a multi-user application (about 10 users). It will be very rare, that users will work on the same data at the same time, but it might happen.
    8. The database type (SAP DB) will not be changed in the near future.
    With these 8 requirements in mind, I dealed a lot with EntityBeans, Hibernate and JDBC with SesseionBeans during the last 2 weeks.
    Until now, I came to the following conclusions.
    Hibernate is too slow. That'S bad, for data is edited very often and sometimes I want to edit just a single cell in 1000-row table.
    Hibernate's biggest advantage - that it makes your application independent of the database type - is not even required (see point 8).
    JDBC with SessioBeans: Very fast (I tried a simple query and it was about 10 times faster than Hibernate).
    The disadvantage is, that I have to take care about all the transaction, concurrency control etc. things.
    If I use JDBC, I want to do it that way: A SessionFacade accesses a DAO-object which executes the DB-query and returns the result to the SessionFacade which in the last step will pass the result to the client.
    Entity Beans: I am completely confused with Entity Beans.
    I read a lot about the CompositeEntity-Pattern for BMP. But on sun's J2EE Pattern page (http://java.sun.com/blueprints/corej2eepatterns/Patterns/CompositeEntity.html)
    they said, that it's just useful when using the EJB 1.1 specification, because from EJB 2.0. the container or whatever will take care about lazy loading and store optimization.
    So, from EJB 2.0. you should prefer using CMP-Beans with Container Managed Relationships (CMR), but as I heard, the dependent objects cannot be accessed and changed by the client when using CMPBeans with CMR.
    However, a simple DB/Entity-mapping will not work in my case, because as mentioned above, there are thousands of products from the db to be managed at the same time. So here, I thought, the Composite pattern with its lazy loading strategy would be useful.
    Furthermore, I have an n:m relationship in my database scheme, which is not trivial to map to entity beans. And don't forget that some related data is spread over 2 databse tables.
    To sum it up, it would be very nice if some of you could clarify this perisistence nightmare, especially some clarification about if and how to use EntityBeans when having n:m relationships, editing data a lot, managing lots of table rows at once and having related data distributed over 2 database tables.
    So, which technology would you prefer with the 8 requirements in mind? Hibernate, Entity Beans or JDBC with SessionBeans? Or would you prefer a mixed solution?
    Thanx for every hint.
    Regards,
    egon

    Here the requested information about the test:
    Goal:
    Find all customers, who's branches have the String "Branch" in their name.
    Both times, a simple client accesses the same SessionBean in a JBOSS-Container.
    This Bean has 2 methods. One accesses the DB via Hibernate (executeCriteria), the other one via JDBC (executeCriteriaJDBC).
    The code to count the seconds of computation is as follows:
    long startTime = System.currentTimeMillis();
    List customerList = bean.executeCriteria(dc);
    System.out.println("Hibernate: "+((System.currentTimeMillis()-startTime)/1000.0f)+" sek");
    startTime = System.currentTimeMillis();
    List customerListJDBC = bean.executeCriteriaJDBC(query);
    System.out.println("JDBC: "+((System.currentTimeMillis()-startTime)/1000.0f)+" sek");
    HIBERNATE:
    CODE:
    Branch Branch = new Branch();
    Branch.setName("%Branch%");
    Example example = Example.create(Branch);     
    DetachedCriteria dc = DetachedCriteria.forClass(Customer.class)
    .createCriteria("branches").add(example.enableLike()).setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
    QUERY:
    select
            this_.UUID as UUID1_1_,
            this_.NAME as NAME1_1_,
            this_.CUSTOMERNO as CUSTOMERNO1_1_,
            this_.SHORTDESC as SHORTDESC1_1_,
            this_.LONGDESC as LONGDESC1_1_,
            this_.TAXNUMBER as TAXNUMBER1_1_,
            this_.SALESTAXID as SALESTAXID1_1_,
            this_.ACCOUNTHOLDER as ACCOUNTH8_1_1_,
            this_.BANKACCOUNT as BANKACCO9_1_1_,
            this_.BANKCODE as BANKCODE1_1_,
            this_.BANKNAME as BANKNAME1_1_,
            this_.AREA1TEXT as AREA12_1_1_,
            this_.AREA2TEXT as AREA13_1_1_,
            this_.AREA3TEXT as AREA14_1_1_,
            this_.AREA4TEXT as AREA15_1_1_,
            this_.AREA5TEXT as AREA16_1_1_,
            this_.CH_UUID as CH17_1_1_,
            this_.REFTEXT1 as REFTEXT18_1_1_,
            this_.REFTEXT2 as REFTEXT19_1_1_,
            this_.REFTEXT3 as REFTEXT20_1_1_,
            branch1_.UUID as UUID0_0_,
            branch1_.NAME as NAME0_0_,
            branch1_.ILN as ILN0_0_,
            branch1_.BRANCHID as BRANCHID0_0_,
            branch1_.SHORTDESC as SHORTDESC0_0_,
            branch1_.LONGDESC as LONGDESC0_0_,
            branch1_.BAGSRECEIVED as BAGSRECE7_0_0_,
            branch1_.CUSTOMER_UUID as CUSTOMER8_0_0_
        from
            CUSTOMER this_,
            BRANCH branch1_
        where
            this_.UUID=branch1_.CUSTOMER_UUID
            and (
                branch1_.NAME like ?
    RESULT:
    Customername: Customer_A
    Customername: Customer_F
    Customername: Customer_D
    Customername: Customer_R
    Customername: Customer_S
    TIME:
    Hibernate: 1.343 sek
    JDBC:
    QUERY:
    Select distinct c.* from Customer c, Branch b where b.id=b.Customer_id and b.name like '%Branch%'
    // After getting the result of the query: Create a list of Customer-objects. Set all attributes of each Customer-object.
    RESULT:
    Customername: Customer_R
    Customername: Customer_A
    Customername: Customer_S
    Customername: Customer_D
    Customername: Customer_F
    TIME:
    JDBC: 0.125 sek
    The Customer.hbm.xml (auto-generated in Eclipse with Middlegen)
    <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
    <hibernate-mapping>
    <!--
        Created by the Middlegen Hibernate plugin 2.2
        http://boss.bekk.no/boss/middlegen/
        http://www.hibernate.org/
    -->
    <class
        name="hibernate.hibernate.Customer"
        table="CUSTOMER"
        lazy="false"
    >
        <id
            name="uuid"
            type="java.lang.String"
            column="UUID"
        >
            <generator class="assigned" />
        </id>
        <property
            name="name"
            type="java.lang.String"
            column="NAME"
            length="100"
        />
        <property
            name="customerno"
            type="java.lang.Integer"
            column="CUSTOMERNO"
            length="5"
        />
        <property
            name="shortdesc"
            type="java.lang.String"
            column="SHORTDESC"
            length="50"
        />
        <property
            name="longdesc"
            type="java.lang.String"
            column="LONGDESC"
            length="100"
        />
        <property
            name="taxnumber"
            type="java.lang.String"
            column="TAXNUMBER"
            length="50"
        />
        <property
            name="salestaxid"
            type="java.lang.String"
            column="SALESTAXID"
            length="50"
        />
        <property
            name="accountholder"
            type="java.lang.String"
            column="ACCOUNTHOLDER"
            length="50"
        />
        <property
            name="bankaccount"
            type="java.lang.String"
            column="BANKACCOUNT"
            length="50"
        />
        <property
            name="bankcode"
            type="java.lang.String"
            column="BANKCODE"
            length="50"
        />
        <property
            name="bankname"
            type="java.lang.String"
            column="BANKNAME"
            length="50"
        />
        <property
            name="area1text"
            type="java.lang.String"
            column="AREA1TEXT"
            length="50"
        />
        <property
            name="area2text"
            type="java.lang.String"
            column="AREA2TEXT"
            length="50"
        />
        <property
            name="area3text"
            type="java.lang.String"
            column="AREA3TEXT"
            length="50"
        />
        <property
            name="area4text"
            type="java.lang.String"
            column="AREA4TEXT"
            length="50"
        />
        <property
            name="area5text"
            type="java.lang.String"
            column="AREA5TEXT"
            length="50"
        />
        <property
            name="chUuid"
            type="java.lang.String"
            column="CH_UUID"
            length="50"
        />
        <property
            name="reftext1"
            type="java.lang.String"
            column="REFTEXT1"
            length="50"
        />
        <property
            name="reftext2"
            type="java.lang.String"
            column="REFTEXT2"
            length="50"
        />
        <property
            name="reftext3"
            type="java.lang.String"
            column="REFTEXT3"
            length="50"
        />
        <!-- Associations -->
        <!-- bi-directional one-to-many association to Branch -->
        <set
            name="branches"
            lazy="true"
            inverse="true"
           cascade="all"
        >
            <key>
                <column name="CUSTOMER_UUID" />
            </key>
            <one-to-many
                class="hibernate.hibernate.Branch"
            />
        </set>
    </class>
    </hibernate-mapping>So, seems to me like Hibernate is also getting the data from the Branch-Table related to each Customer. Maybe this is the reason, why Hibernate is slower.
    But as you can see in the mapping-File of the customer, I wanted Branches to be lazy loaded.
    Do you have any ideas, why Hibernate is so much slower? Any hints for optimizing that code?
    Do you have any further tricks to optimize Hibernate? Unfortunately I am not allowed to make changes at the database, so I cannot e.g. set indices for optimization.
    However, I�m a Hibernate-Newbie. In fact, I just made this test and was very disappointed about its result, so I didn�t keep on working with Hibernate.
    But maybe you can proof me, that Hibernate is a good choice. If so, do you have any good resources (links, books) that help working with Hibernate in connection with JBOSS, describe how to map n:m relationships, show how to work with large results and so forth?
    Thanx for help,
    egon

  • Extreamly slow container managed persistence

    Hi.
    We perform the following procedure:
    1. We invoke a finder method on a container managed bean
    2. Then we traverse the enumeration of beans returned and invoke a getter
    method to get their properties.
    The finder finishes really fast, but then traversing the enumeration takes
    about 1 second per entity bean.
    Any suggestions?
    Giora Katz-Lichtenstein

    Hi,
    When you're iterating through your collection or enumeration of primary
    keys, each method call is going to the database to retrieve the row
    associated with that primary key. I'll bet the issue is with the calls to
    the db or whatever persistent store you're using.
    Steve...
    Giora <[email protected]> wrote in message
    news:82kolv$192$[email protected]..
    Hi.
    We perform the following procedure:
    1. We invoke a finder method on a container managed bean
    2. Then we traverse the enumeration of beans returned and invoke agetter
    method to get their properties.
    The finder finishes really fast, but then traversing the enumeration takes
    about 1 second per entity bean.
    Any suggestions?
    Giora Katz-Lichtenstein

  • 1-many CMP2.0 Container Managed Persistence

    Sorry for posting this again, but there did not seem to be any replies.
    I have noticed a very strange phenomena in 1-many container managed relationships in the J2EESDK1.3.
    In 1-many Container Managed Relationships, the J2SDKEE1.3 actually generates 3 tables rather than 2. The first table is the 1 side table. The second table is the many side table. The third table is a relation table joining the 1 side table and many side table. This relation table has 2 fields, one is the primary key of the many side table (this field becomes the primary key of the relation table) and the other field is the primary key of the one side table.
    This generation of a new table for 1-many relationships is giving me a headache because these tables now form a (0 or 1) - many relationship now.
    Is this defined as part of the EJB2.0 spec or is this a J2SDKEE1.3 dependant feature?

    I'm afraid I can't give you an exact answer to this question, but it seems to me that this is a work-around in order not to create the relationshis in the DB.
    I have noticed this behaviour as well, only I have found another problem with it. The relationship table doesn't seem to survive an undeploy or server restart. Do you have the same problem?
    I think that maybe a commercial application server with a database for which it has been optimized will not show this behaviour, but will define the relationship as meta-data in the DB.

  • Container managed persistence

    Hi!
    I'm trying to figure out how CMP works with IPlanet but haven't found any
    examples. I would need to know where to define the table names that my
    entity beans use?
    Sebastian

    Hi Seb,
    Please find the attached file .....will help u
    Ananthram
    "Sebastian Lofhjelm" wrote:
    Hi!
    I'm trying to figure out how CMP works with IPlanet but haven't found any
    examples. I would need to know where to define the table names that my
    entity beans use?
    Sebastian

  • Bean-Managed Persistent Entity Bean - SDA

    Hello,
    I wrote a BMP Entity Bean and it should use a data dictionary that i already have defined, but i do not know what should i write in the ejb-jar.xml file in order to get it works. Could you please tell me what should i write?
    <resource-ref>
      <res-ref-name>???</res-ref-name>
      <res-type>????<res-type>
    </resource-ref>
    Thanks for your help,
    SAPLernen

    Hello,
    I wrote a BMP Entity Bean and it should use a data dictionary that i already have defined, but i do not know what should i write in the ejb-jar.xml file in order to get it works. Could you please tell me what should i write?
    <resource-ref>
      <res-ref-name>???</res-ref-name>
      <res-type>????<res-type>
    </resource-ref>
    Thanks for your help,
    SAPLernen

  • Type of Serialized Object for Entity Bean

    Hi,
    I develop a container managed persistence entity bean. I want to persist an object that is serializable into a database column. My database column type is a Blob. I wonder what is the type of a field in my entity bean? Please help. Thanks in advance.
    Cheers,
    Paul Ngo

    Providing you are not worried about referential integrity, CMP will do this automatically.

  • Error deploying entity bean on web logic server

    i am trying to deploy a container managed persistence entity bean on web logic server when i run the command ejbc which generates the final jar file ready to deploy having its stub and skeleton it gives me the error that the return type of create(int) method should have a type of bean home interface while in accordance with ejb1.1 specicication it should be the type of primary key and a null value should be returned.
    plz let me know where i am doing it wrong.

    thanks for ur quick response sir i am using this services provided by sun microsystem first time and
    am really thankful to Sun Microsystem for this great deal of help to the new commers but sir my problem is still there.
    following is the method which i have written in the code
         public InvoicePK ejbCreate(int id)
              this.id=id;
              return null;
    and here it is the error generated by the server deployment tool.
    [9.2.8] In EJB Invoice, the return type for the create method create(int) must be the bean's remote interface type.
    [9.2.8] In EJB Invoice, the findByPrimaryKey method must return the Entity bean's remote interface type.
    [9.2.8] In EJB Invoice, the return type for the method findByPrimaryKey(com.swi.InvoicePK) must be the entity bean's remote interface type (for a single-object finder) or a collection thereof (for a mult-object finder).
    the detail of files created by me are as follows.
    1. Invoice (Entity Bean)
    2. InvoicePK (Primary Key file)
    3. MyRemoteInterface (remote interface for entity bean)
    4. MyHomeInterface (home interface for entity bean)
    plz let me know where i am doing wrong and oblige.

  • CMP Entity Beans read database row twice?

    Here are two basic questions regarding container managed persistence Entity Beans:
    How many database read operations are performed when a remote reference to a CMP Entity Bean is obtained by a client?
    Is it correct, that each row is read twice?
    For example if a have one row in a database which I want to lookup, AFAIK first the findByPrimaryKey method perfoms a select to lookup the primary key, and then the (container-)ejbLoad method actually reads the row a second time to populate the CMP fields of the bean.
    And how often are UPDATE statements performed?
    Is a database UPDATE statement performed each time a setXX method is invoked?
    Thanks for any help,
    Robert

    How many database read operations are performed when a
    remote reference to a CMP Entity Bean is obtained by a
    client?
    Is it correct, that each row is read twice?It all depends on the CMP system. A simple system might well hit the database twice, once to validate the primary key and once to load the object's fields. A
    smarter system might try to cache the results from the first, so it didn't need to do the second (although this might be a bit dodgy from a transactional point of view).
    However, a couple of facts about databases come in here. Firstly, the query to check the primary key doesn't actually need to load any data from the table: it just needs to check that the key exists. Thus, it should be possible to handle this query just using the index, not touching the table itself at all. Secondly, databases do their own caching, so if a row was loaded in the first query, there is a good chance that it would still be around for the second.
    And how often are UPDATE statements performed?
    Is a database UPDATE statement performed each time a
    setXX method is invoked?Under CMP 1.1, UPDATES are typically done at the end of a transaction; if you use container-demarcated transactions, then yes, UPDATES will happen after every call. If the client code sets up its own transaction, then the UPDATE will only happen after several setXXX calls.
    This can be a performance problem. A common solution is the use of coarse-grained detail objects:
    http://java.sun.com/j2ee/blueprints/sample_application/model/ (section 10.4.1.2)

Maybe you are looking for

  • EXCEL TO SQL USING SSIS Error

    I have an .XLSLX File.  I have a DFD Task to export that xlsx file into SQL. I use SSIS 2008. However when I run the package, it fails with this error below. [Connection manager "Excel Connection Manager"] Error: SSIS Error Code DTS_E_OLEDB_EXCEL_NOT

  • How can I go back to Windows 8.1?

    Hi! I have Lenovo miix2 8" tablet, delivered with Wind​ows 8.1. I installed the Windows 10 Technical Prev​iew on it but I want to go back to the Windows 8.1. However, the installation does not start not the recovery part of hard disk nor USB driver t

  • I can't get cd's to play on my iMac. What could be the cause?

    what could be causing cd'sno to play on my iMac? Also what maybe some low cost but reliable fixes?

  • Select printer when printing purchase order

    Hello, we are using a customized sapscript and the standard SAP print program  SAPFM06P to print out our purchase orders . When doing the print out of ME22n, we can select the printer in logical destination field. But if we select LOCL, we can not se

  • Subscription has been suspended

    Hi,  I got the following message " Your subscription has been suspended as you have exceeded your allocated free minutes. Your free minutes will start again on DEC 3, 2011" I did new payment in Nov 30 2011 and subscription still suspended. Thanks