CMR relations

I discovered that the underlying cause of the previous error I was getting was that
I was attempting to access a CMR collection field from a remote client. The cause
of the underlying error I get from weblogic is:
"Attempt to serialize a collection that implements a cmr-field. Collections managed
by the CMP RDBMS persistence manager may not be passed directly to a remote client."
This doesn't seem very "remote object-ish". Which leads me to believe that there
must be a way to do this. If not, it kind of raises the question of "what good are
WL CMP entity beans as true remote objects?". If there is a way to do this, could
someone kindly point me in the right direction?

Errp.. I responded to your other message before reading this one. See that
response for one workaround if you REALLY want to have remote interfaces
directly to entity beans with CMR fields. Personally I either use the
Session Facade pattern for remotes or just package EJBs and web-app
components together in an EAR and use entity-bean local interfaces directly
from web-app components. This "direct" approach allows complete, natural
traversal through the object graph, including cmr collections. Downside is
transactional requirements and coupling between webapp components and bean
attributes, but that seems a small price to pay for natural "OO" interaction
with entities.
-Greg
Check out my WebLogic 6.1 Workbook for O'Reilly EJB Third Edition
www.amazon.com/exec/obidos/ASIN/1931822468 or www.titan-books.com
"Steve Ebersole" <[email protected]> wrote in message
news:3cf7cd73$[email protected]..
>
I discovered that the underlying cause of the previous error I was gettingwas that
I was attempting to access a CMR collection field from a remote client.The cause
of the underlying error I get from weblogic is:
"Attempt to serialize a collection that implements a cmr-field.Collections managed
by the CMP RDBMS persistence manager may not be passed directly to aremote client."
>
This doesn't seem very "remote object-ish". Which leads me to believethat there
must be a way to do this. If not, it kind of raises the question of "whatgood are
WL CMP entity beans as true remote objects?". If there is a way to dothis, could
someone kindly point me in the right direction?

Similar Messages

  • An CMR related exception

    Hi! I am using Weblogic 6.1 SP2 and EJB 2.0. I built a CMR between two
    Entity Beans. However, I got the following exception while running:
    "javax.ejb.EJBException: When a cmp-field and a cmr-field (relationship) are
    mapped to the same column, the setXXX method for the cmp-field may not be
    called. The cmp-field is read-only."
    However, in the ejbCreate() method in CMP in EJB 2.0, I have to use setXXX
    method to initialize the XXX cmp-field. Am I wrong?
    Can any guru help? thanks!

    See section 10.5.2 discussion on ejbCreate<METHOD>.
    -- Anand
    "alvin" <[email protected]> wrote in message
    news:[email protected]..
    Anand, thanks! I tried with ejbPostCreate(). Still does not work. Couldyou
    point out which section in the Spec has what you said? Thanks again.
    "Anand Byrappagari" <[email protected]> wrote in message
    news:3c8cdae1$[email protected]..
    Not sure if I understand your question but I believe you cannot call the
    setXXX methods on an CMR field in the ejbCreate() method. The earliest
    you
    can do is in the ejbPostCreate(). This is a constraint set by the Spec.
    -- Anand
    "alvin" <[email protected]> wrote in message
    news:3c8cb874$[email protected]..
    Thanks! thorick,
    Is this contrain set by EJB 2.0 Spec or by Weblogic itself? And HOW to
    do
    the "manipulation of the relationship" to workaround?
    Details pls, Thanks!
    "thorick" <[email protected]> wrote in message
    news:[email protected]..
    Alvin wrote:
    thorick, my exception is raised just in ejbCreate() when I call
    setXXX().
    Are you sure you explaination is true? or it is just your
    understanding?
    Thanks!
    Ah, major retraction time. Sorry, I was confusing the situation
    with
    the
    general case of setting a Primary Key cmp-field.
    It turns out that one may NEVER call setXXX() in a cmp-field that
    is mapped to a column that is also a foreign-key column which is
    managed by the EJB Container. This not allowed because of the samereason I
    mentioned in the previous post: to call setXXX() on such a field
    would
    amount to
    managing a relationship outside
    of the EJB Container's mechanism for managing a relationship.
    You may do getXXX() but never setXXX().
    The only way to set the value of the column is via manipulation of
    the relationship.
    Sorry for any confusion !
    -thorick

  • CMR problem

    Hi friends
    I am using weblogic,ejb ,XDoclet...Doing one CMR relation program
    I have tow tables
    1.Order_detail
    2.Order_header
    In order_detail table i have PK serial number and FK po_no
    In order_header table i have PK po_no
    It is like order has many items program
    Im CMR relation i gave
    bold/**
         * <!-- begin-user-doc -->
         * CMR Field items
         * Returns the items
         * @return the items
         * <!-- end-user-doc -->
         * <!-- begin-xdoclet-definition -->
         * @ejb.interface-method
         * view-type="local"
         * @ejb.relation
         * name="order_header"
         * role-name="Order-contains-Items"
         * target-ejb="OrderDetail"
         * target-role-name="item-contained-in-order"
         * target-cascade-delete="yes"
         * @weblogic.target-column-map
         * foreign-key-column="po_no"
         * key-column="po_no"
         * <!-- end-xdoclet-definition -->
         * @generated
    public abstract java.util.Collection getItems();
    * <!-- begin-user-doc -->
    * Sets the Items
    * @param java.util.Collection the new items value
    * <!-- end-user-doc -->
    * <!-- begin-xdoclet-definition -->
    * @ejb.interface-method
    *           view-type="local"
    * <!-- end-xdoclet-definition -->
    * @generated
    public abstract void setItems(java.util.Collection items);*bold*
    I am getting the error of
    When a cmp-field and a cmr-field (relationship) are mapped to the same column, the setXXX method for the cmp-field may not be called. The cmp-field is read-only.
    Please help me to sort out this.
    thanks in advance

    i had this same problem of recent. i never included the cmp(setter and getter of fk). i worked with the cmr
    setter and getter. it worked but do not know if this was a standard.
    Sumelong

  • Additional field in join table for CMP EJB

    Hello,
    I'm trying to perform this task using CMP entity beans:
    The entity A has a CMR relation of cardinality m-n with entity B (bidirectional) (This is working fine).
    I want to add a parameter to the relation.
    Ex : When I find that A1 is linked to B1, I need to perform "x" times an action. x would be my parameter, and I would have kept this parameter as an additional column in the join table A_TO_B.
    Could anyone provide an example of how to perform this with CMP EJB?
    NOTE: I'm using OC4J 10g 9.0.4 standalone (and cannot change my version).
    Thanks
    Tanguy

    Manohar,
    You need to create an append structure for table VBAP (for example ZAVBAP) using SE11. In this structure you create your ZZ fields. If you need a non-SAP domain/data element for your field then you need to create it first using the same transaction and activate it. Attach ZAVBAP to VBAP so the SE11 shows:
    .APPEND in the Fields column and
    ZAVBAP in the Field type column.
    Your ZZ fields will be shown automatically.
    When you have finished then activate your ZAVBAP structure. You will notice when you go VA01 (for example) that a lot of programs are being recompiled. Don't worry. It will be ok.
    The user-exit screen number for items is 8459 (in program SAPMV45A).
    Thanks,
    Wojtek

  • Deploying  wl7 restriction : can't deploy ear if one ejb failed

    In weblogic 6, I was able to deploy an ear even if one ejb of the ear could not
    deploy. With weblogic 7 if one ejb failed, the all ear fail to deploy (There is
    no cmr relation between those ejb). This a realy big restriction in development
    mode, if you don't care about the failed ejb. You need to remove it from your
    ear build and redeploy... Is there any way to have the same behaviour than in
    wl6 ?
    thank's
    Nicolas FRANK

    In weblogic 6, I was able to deploy an ear even if one ejb of the ear could not
    deploy. With weblogic 7 if one ejb failed, the all ear fail to deploy (There is
    no cmr relation between those ejb). This a realy big restriction in development
    mode, if you don't care about the failed ejb. You need to remove it from your
    ear build and redeploy... Is there any way to have the same behaviour than in
    wl6 ?
    thank's
    Nicolas FRANK

  • RESTful webservices invocation from OSB.

    Can some one please explain the best way to develop the OSB service to invoke the Restful services.
    1. Only proxy service is enough to handle the request, no need of business service?
    2. when moving the code from one env to other, we use a business service to update endpoint url which is the common approach we generally follow, to make the osb service loosely coupled. how to use the business service when invoking the restservice? does we have the base uri value in the transport url and will get appended with the relative-uri value which we frame as part of the request in the outbound variable in the proxy settings?
    3. when invoking the rest service do we need to append all the request message to the url itself or the request can be passed separately as request body and the main rest uri will have only the key fields as part of the relative-uri?
    4. If we receive huge request message does the URL support the entire request?
    5. how the response/error will be returned when calling the Restful webservice?
    I am assuming this appraoch. Can some one please confirm does this approach works with RESTful service invocation from OSB.
    Request processing:
    Source System request-> Proxy Service -> Transformation to end system specific -> Business service (with base-uri -> http://mainappl.com/web/cmr/{relative-uri from outbound transport}) -> endsystem
    Response processing:
    endsystem Response/Error -> Business Service -> Proxy Service -> transformation to source system specific -> source system.
    Please advice which is the best approach to follow while invoking the RESTful webservices from OSB.
    Thanks..
    Edited by: user12679330 on May 5, 2010 4:33 AM
    Edited by: user12679330 on May 5, 2010 5:00 AM

    Hi,
    Thanks for the update. Can you please explain the above mentioned approach works or how it should be?
    I have one requirement, can some one explain the implementation for this:
    I have one element which is of type unbound. I need to map this element to a single enelement value by separating each element value with a ;, before that I need to check wheteher this element(s) are present in the request then need to appened all these element values to a single element and the end of this element need to append default values.
    Scenario:
    <student>
    <name>asd</name>
    <address>
    <street>street1</street>
    <street>street2</street>
    <street>street3</street>
    ||
    ||
    </address>
    to be mapped it to:
    <student>
    <field name="NAME">asd</field>
    <field name="ADDRESS">street1;street2;street3;default1;default2;default3</field>
    </student>
    Here need to check if street names are present in the request xml, if yes ned to assign it to ADDRESS as mentioned above if street names present or not need to append the default values at the end to the ADDRESS field.
    Thanks in advance.

  • Entity Dependants & writable entities

    [att1.html]

    In 7.0, CMR would be the most efficient route since it can read the bean
    and its relation in one db round-trip.
    If you want some more ideas, you'll have to answer my other questions in
    the previous post.
    -- Rob
    "DAGHFAL Carole(LB Soft)" wrote:
    I know that CMR works in this case but I'm searching for a solution
    that minimize database round-trips and optimize performance!
    For that I'm trying to avoid using CMRs by implementing the concept of
    dependencies .
    Rob Woollen wrote:
    "DAGHFAL Carole(LB Soft)" wrote:
    Hi all,
    I have the Operation table in the database that has the operationId
    as Primary Key ,this table is linked to another table called
    OperationNormal by the operationId
    For the Operation table I need to get the corresponding data from
    the OperationNormal table.
    In this case i had created the Operation as my Entity and the
    OperationNormal as dependant class and get
    the corresponding data using SQL statements in ejbLoad of
    Operation.Is the Operation entity CMP or BMP? Do you want to load the
    Operation and OperationNormal in one SQL Join?
    But once I had to add a record in the operation table I should add
    a corresponding one in the OperationNormal table.Yes, it sounds like you'll have to insert into the OperationNormal
    table after you've done the operation insert.
    Should I create two writable entities one OperationWrite and the
    other OperationNormalWrite to be able to write into the two tables
    ?Are the Operation and OperationNormal beans read-only?
    In this case I would use the dependant class only to read the data
    from the OperationNormal table and the OperationNormalWrite to be
    able to write to the OperationNormal table.
    Or Should I implement the two tables as 2 entities with CMR
    relation between them and forget about the dependant class????CMR would work fine in this case as well.
    -- Rob
    >
    AVAILABLE NOW!: Building J2EE Applications & BEA WebLogic Server
    by Michael Girdley, Rob Woollen, and Sandra Emerson
    http://learnWebLogic.com
    [att1.html]

  • Problem creating sun-cmp-mappings.xml with xdoclet

    I am using xdoclet to create a deployable ear file for the Sun ONE app. server. I am having problems getting a correct sun-mappings.xml file with the correct cmr relation fields.
    As an example I created two beans; Account and AccountGroup. AccountGroup has a 1:n relation to Account via the cmr field account. If I look at the resulting sun-mappings file I also get a cmr field "account" in the Account bean, which shouldn't be there.
    Can anybody give me a clue what's wrong with this code.
    AccountGroupEJB.java :
    package test;
    import javax.ejb.*;
    import java.sql.*;
    import javax.sql.*;
    import javax.naming.*;
    * @ejb.bean
    * name="AccountGroup"
    * jndi-name="ejb/accountgroup"
    * local-jndi-name="ejb/accountgroup"
    * primkey-field="id"
    * cmp-version="2.x"
    * schema="AccountGroupSchema"
    * type="CMP"
    * view-type="local"
    * transaction-type="Container"
    * @ejb.pk
    * generate="false"
    * @ejb.transaction type="Required"
    * @ejb.permission unchecked="True"
    * @ejb.resource-ref
    * res-ref-name="jdbc/test"
    * res-type="javax.sql.DataSource"
    * res-auth="Container"
    * res-sharing-scope="Shareable"
    * jndi-name="jdbc/test"
    * @ejb.finder
    * view-type ="local"
    * method-intf="LocalHome"
    * query="select distinct object (a) from AccountGroupSchema a"
    * signature="java.util.Collection findAll()"
    * @ejb.finder
    * view-type ="local"
    * method-intf="LocalHome"
    * query="select distinct object (a) from AccountGroupSchema a where a.id = ?1"
    * signature="clover.AccountGroupLocal findByPrimaryKey(java.lang.Integer id)"
    * @ejb.persistence
    * table-name="accountgroup"
    public abstract class AccountGroupEJB implements EntityBean{
    public AccountGroupEJB() {
    private EntityContext ctx;
    * @ejb.create-method
    * view-type="local"
    public Integer ejbCreate(Integer id,String name) throws CreateException {
    setId(id);
    setName(name);
    return null;
    public void ejbPostCreate(Integer id,String name) throws CreateException {
    public void ejbActivate() {}
    public void ejbLoad() {}
    public void ejbPassivate() {}
    public void ejbRemove() {}
    public void ejbStore() {}
    public void setEntityContext(EntityContext ctx) {
    this.ctx=ctx;
    public void unsetEntityContext() {
    this.ctx=null;
    //abstract acessor methods for all persistent field
    * @ejb.persistent-field
    * @ejb.persistence
    * column-name="accountgroup.id"
    * @ejb.interface-method
    * view-type="local"
    * @ejb.pk-field
    public abstract Integer getId();
    public abstract void setId(Integer id);
    * @ejb.persistent-field
    * @ejb.persistence
    * column-name="accountgroup.name"
    * @ejb.interface-method
    * view-type="local"
    public abstract String getName();
    * @ejb.interface-method
    * view-type="local"
    public abstract void setName(String name);
    * @ejb.interface-method
    * view-type="local"
    * @ejb.relation
    * name="AccountGroup:Account"
    * target-ejb="Account"
    * role-name="AccountGroup:account"
    * target-role-name="Acount"
    * multiple="yes"
    * @sunone.relation
    * column="accountgroup.id"
    * target="account.accountgroup_id"
    public abstract java.util.Collection getAccount();
    * @ejb.interface-method
    * view-type="local"
    public abstract void setAccount(java.util.Collection accounts);
    AccountEJB.java:
    package test;
    import javax.ejb.*;
    import java.sql.*;
    import javax.sql.*;
    import javax.naming.*;
    * @ejb.bean
    * name="Account"
    * jndi-name="ejb/account"
    * local-jndi-name="ejb/account"
    * cmp-version="2.x"
    * schema="AccountSchema"
    * primkey-field="login"
    * type="CMP"
    * view-type="local"
    * transaction-type="Container"
    * @ejb.pk
    * generate="false"
    * @ejb.transaction type="Required"
    * @ejb.permission unchecked="True"
    * @ejb.resource-ref
    * res-ref-name="jdbc/test"
    * res-type="javax.sql.DataSource"
    * res-auth="Container"
    * res-sharing-scope="Shareable"
    * jndi-name="jdbc/Mysql"
    * @ejb.finder
    * view-type ="local"
    * method-intf="LocalHome"
    * query="select distinct object (a) from AccountSchema a"
    * signature="java.util.Collection findAll()"
    * @ejb.finder
    * view-type ="local"
    * method-intf="LocalHome"
    * query="select distinct object (a) from AccountSchema a where a.login = ?1"
    * result-type-mapping="Local"
    * signature="clover.AccountLocal findByPrimaryKey(java.lang.String login)"
    * @ejb.persistence
    * table-name="account"
    public abstract class AccountEJB implements EntityBean{
    public AccountEJB() {
    private EntityContext ctx;
    * @ejb.create-method
    * view-type="local"
    public String ejbCreate(String login, String name) throws CreateException {
    setLogin(login);
    setName(name);
    return null;
    public void ejbPostCreate(String login, String name) {
    public void ejbActivate() {}
    public void ejbLoad() {}
    public void ejbPassivate() {}
    public void ejbRemove() {}
    public void ejbStore() {}
    public void setEntityContext(EntityContext ctx) {
    this.ctx=ctx;
    public void unsetEntityContext() {
    this.ctx=null;
    //abstract acessor methods for all persistent field
    * @ejb.persistent-field
    * @ejb.persistence
    * column-name="login"
    * @ejb.interface-method
    * view-type="local"
    * @ejb.pk-field
    public abstract String getLogin();
    public abstract void setLogin(String login);
    * @ejb.persistent-field
    * @ejb.persistence
    * column-name="name"
    * @ejb.interface-method
    * view-type="local"
    public abstract String getName();
    * @ejb.interface-method
    * view-type="local"
    public abstract void setName(String name);
    sun-cmp-mappings.xml:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE sun-cmp-mappings PUBLIC "-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 7.0 OR Mapping //EN" "http://www.sun.com/software/sunone/appserver/dtds/sun-cmp-mapping_1_0.dtd">
    <!-- Generated by XDoclet -->
    <sun-cmp-mappings>
    <sun-cmp-mapping>
    <schema>CloverSchema</schema>
    <entity-mapping>
    <ejb-name>AccountGroup</ejb-name>
    <table-name>accountgroup</table-name>
    <cmp-field-mapping>
    <field-name>id</field-name>
    <column-name>accountgroup.id</column-name>
    </cmp-field-mapping>
    <cmp-field-mapping>
    <field-name>name</field-name>
    <column-name>accountgroup.name</column-name>
    </cmp-field-mapping>
    <cmr-field-mapping>
    <cmr-field-name>account</cmr-field-name>
    <column-pair>
    <column-name>accountgroup.id</column-name>
    <column-name>account.accountgroup_id</column-name>
    </column-pair>
    </cmr-field-mapping>
    </entity-mapping>
    <entity-mapping>
    <ejb-name>Account</ejb-name>
    <table-name>account</table-name>
    <cmp-field-mapping>
    <field-name>login</field-name>
    <column-name>login</column-name>
    </cmp-field-mapping>
    <cmp-field-mapping>
    <field-name>name</field-name>
    <column-name>name</column-name>
    </cmp-field-mapping>
    <cmr-field-mapping>
    <cmr-field-name>account</cmr-field-name>
    <column-pair>
    <column-name>accountgroup.id</column-name>
    <column-name>account.accountgroup_id</column-name>
    </column-pair>
    </cmr-field-mapping>
    </entity-mapping>
    </sun-cmp-mapping>
    </sun-cmp-mappings>

    Here is a link to my patch:
    http://opensource.atlassian.com/projects/xdoclet/secure/attachment/10294/sunone-rel.patch
    Since the patch was created based on a 1.2.0 it is possible that you have to edit in my changes manually.
    Note also that my version doesn't support the "target-" attribues. You have to have CMR methods on both sides of the relationship. If one of the methods shouldn't be accessible you can leave out the interface-method tag, and the method will then act as a just a placeholder for xdoclet tags.
    For what it's worth we are using my patched xdoclet module to generate descriptors for several hundred CMP/CMR beans and it works perfectly.
    /Gunnar

  • CMP Entity beans using local interfaces

    Why CMP entity beans with CMR relation ship using local interfaces only?
    Why we should not use remote interface to get the CMR field relationship?
    Pls give me the solutions

    "Local interfaces provide the foundation for container-managed relationships among entity beans and session beans. The bean uses the local interface to maintain its references to other beans. For example, an entity bean uses its local interfaces to maintain relationships to other entity beans. Using local interfaces, beans can also expose their state and use pass-by-reference to pass their state between related bean instances. "
    http://java.sun.com/developer/technicalArticles/ebeans/EJB20CMP/

  • Erro when deploy application with S1Studio 5

    HI there,
    I am using Sun One Studio 5 Update1 for developing j2ee application. When I tried to deploy the Test Application generated by the IDE, I got the following errors. FYI, "Order" and "OrderItem" are 2 CMR- related CMP entities. Your helps are very appreciated.
    wjw/ejb/taxer/test/OrderitemBean.java [76:5] Entity bean Orderitem's bean class �wjw.ejb.taxer.test.OrderitemBean's abstract methord getOrderid() must be cmp-field or cmp-field access programing methord.This methord should be deleted.
    wjw/ejb/taxer/test/OrderitemBean.java [78:5] entitry bean Orderitem's bean class wjw.ejb.taxer.test.OrderitemBean's abstract methord setOrderid(wjw.ejb.taxer.test.LocalOrder orderid)must be cmp-field or cmp-field access programing methord This methord should be deleted.
    wjw/ejb/taxer/test/OrderBean.java [79:5] entity bean Order's bean class wjw.ejb.taxer.test.OrderBean's abstract methord getChildren() must be cmp-field or cmp-field access programing methord. This methord should be deleted.
    wjw/ejb/taxer/test/OrderBean.java [81:5] entity bean Order's bean class. wjw.ejb.taxer.test.OrderBean's abstract methord setChildren(java.util.Collection children) must be cmp-field or cmp-field access programing methord. This methord should be deleted.
    Errors compiling TestController_TestApp.

    Please provide the details of the method definition for OrderitemBean.getOrderId(), OrderitemBean.setOrderId(), OrderBean.getChildren() and OrderBean.setChildren().

  • Rollback CMP Transaction

    Hi
    I am checking for one object and if that is null i want to throw Application exception from my EJB. Now if i thorw application exception container does not rollback the data. We need to set ctx.setRollbackOnly.
    say i have method
    public void setData(ValueObject MyVO)
    if(MyVO!=null)
    // do something
    else
    ctx.setRollbackOnly()
    throw new myexception("Null obj VO");
    am i on the right track. I beleive this will allow me to throw application exception as well as rollback the transcation.
    I am using weblogic 7.0 with ejb2.0 and CMR relations. All my transactions attributes are set to Required
    Pranav

    Hey thanks for your input.
    But just a quick question for you.
    Can i create a application exception extends EJBException
    so that now when i thorw MyExp it will not have to call ctx.setRollbackOnly.
    Like this
    TestEJB.java
    public void setData(MyVO vo)
    if(vo==null)
    thorw new MyExp("Cannot be null");
    in this even if i dont call rollback on context still it will rollback cos now my exception is child of ejbexception(system exception)
    am i right
    which is the best way to do though.
    This one or one which i asked as first quesrtion
    thanks
    pranav

  • Ship to party and vendor relation in third party process

    Hello Experts,
    I need your precious suggestions on my business requirement.
    When we create the third party sales order system creates the Purchase Requisition and further PO is created through purchasing department.
    Suppose in my third party sales order I have two items X & Y, and both need to deliver at two different ship to party XXX & YYY respectively. in order system determine plant 1000 for both materials based on plant determination (CMIR >> CMR >> MMR) and system generates PR.
    I know while converting the PR to PO system check Source list (ME01) to determine the vendor. my requirement is I want to determine Vendor based on ship to party in sales order. suppose ship to party locations for XXX and YYY are Bangalore and Pune respectively and in both place we have different vendor. Both vendor manufacture product X & Y. so I want system should pick the vendor according to ship to party.
    Is there any relation between ship to party and vendor which will work in third party processing ?
    Kindly explain how I can achieve this requirement.
    Thanks,

    I doubt this can't be achieved by SAP standard functionality. You may need to use user exit. Check Third party to purchase req user exit or purchase req user exit to fulfill the requirement.
    Regards,

  • EJB Finder View Links and CMR

    Hi,
    Can someone please give me some input on the following warning in the JDeveloper online help!
    "Warning: You cannot create an EJB finder view link that expresses the same relationship as a CMR."
    I'm new to EJB, BC4J and JDeveloper. I created container managed entity beans with local interfaces only to represent my data and relationships. No problems with the mapping so far.
    To test the beans I used Session Facades with remote interfaces and build a sample test client.
    Now I thought I could create EJB Entity Facades, EJB Finder View Objects, EJB Finder View Links and EJB Application Modules to make use of the BC4J framework in order to speed up programming clients (JSP and JClient).
    So I've started studying the JDeveloper online help (which seems to be very useful) and found the above mentioned warning.
    Well, better a warning than nothing at all, but some more explanations would have been even better.
    Is there no need to use view links with CMR?
    How to achieve the same functionality (synchronizing two view objects in a master-detail-relationship) with CMR?
    Do you know any examples? I couldn't find any examples using EJB entity facades in the "sample code" area on OTN.
    Any comments about other (better) architectures are also welcome. Would it be better to use BMP entity beans in conjunction with BC4J?
    Many thanks for your help!
    Regards,
    Eric

    Steven,
    thank you for your reply and suggestions - I'll count on that. If I find time I'll read this book. It seems to be very interesting.
    For educational purposes I'd like to look at both persistence implementation strategies. I agree that it looks definitly easier to use entity objects. Certainly it's also performancewise a better choice.
    Anyhow, could you give me some useful tips for cmp entity beans and finder view objects?
    Is there something which works completely different if I use BC4J on top of it?
    How to implement a master-detail relationship in JClient (Swing) for example?
    What about writing an ejbfinder which doesn't return all, but all data where the foreign key is equal to a parameter passed to the finder method and use this as the source for a detail view object. This could be the primary key of the selected master. Well, I don't know whether this is doable. But that's what comes to my mind spontaneously.
    Would this be a solution? I'm still thinking about the aforementioned warning in the online help regarding view links.
    I guess the problem is that the foreign key is not part of the entity bean as it's not a cmp-field. Instead you have accessor methods to retrieve a related object or a collection of objects.
    I'm sure my questions are not too complicated to answer. It's only hard for a beginner to get an overview.
    I'm quite confident that I'll manage this if I give my best and get some help from knowledgeable people like you Steven.
    Regards,
    Eric

  • CMR Problem: Can you create CMR beans in different packages?

    I created a Related Entity bean (ClassA) and unchecked the boxes that indicated it would create the other entity beans that were linked to the table.
    I then created new Entity beans (ClassB and ClassC) in separate packages. I then set up the relationships in the ClassA Related module. Did the mappings, etc.
    When I compile the application I get an error message indicating that the accessor methods (which the IDE auto-generates!) to what I have set as CMR fields can only be for CMP or CMR fields!
    I've tried the PartsSupplier2CMR example and deployed it, but it is a flat tree.
    Has anyone else come across something like this??
    Thanks

    I copied and pasted your code as well as made c08 and c09 directories. I had no errors compiling. I am using NT, but it appears that your problem is Classpath related. You can try to CD to the C:\Java directory and compile using "javac c09\Test.java" That's the command I used.

  • Many-to-Many CMR

    hi all,
    i defined two entity beans, Quiz and Question, with many-to-many cmr and
    a table named Quiz_questions_Question_quizesTable is created in the database after deployment process. the formed table columns consist of primary key of Quiz and primary key of Question, as expected. what i want to do is adding one more column to this table that shows the sequence number of the related question in the related quiz. is it possible? and how? or what should i do?
    thanks in advance..

    "what i want to do is adding one more column to this table that shows the sequence number of the related question in the related quiz."
    Makes sense, but then the association table is no longer just an association table.
    Perhaps a way to get you in the right frame of mind is, "how would you model this with just objects?"
    Basically a CMR just represents an association between two objects. You would see in your revised object model that you do not have a simple n-to-n association between a Quiz objects and a Question objects.[Quiz](0..n)---->(1..n)[Question]The above (bastardized UML) model does not represent the enumeration of Question objects within the scope of a single Quiz object.
    Perhaps the following is more accurate:[Quiz](1)---->(1..n)[QuizQuestion](0..n)---->(1)[Question]or                     [Question]
                              A
                              |
                              |
    [Quiz](1)---->(1..n)[QuizQuestion]It is only after you have your object model that you should worry about the entity bean stuff.

Maybe you are looking for

  • Unable to Import from My Picture Folders

    I today downloaded Photoshop Album 2 Starter. The following ODBC error message was received (Internal Error : Data Not Found)when I tried to import folders with images from 'My Pictures'. All my images previously held by my previous Photoshop Album 1

  • While "Invoice Cancelling- Accounting entry not effected in Trial balance"

    Dear All, Any one knows this please revert back.this Issue is very urgent (We have to Close the Periods) Issue: While "Invoice Cancelling- Accounting entry not effected in Trial balance" Invoice which is cancelled and accounting events for Invoice &

  • How can i switch off 3G in iOS 8

    It seems that this question has not been asked yet, so here it is: How do I switch off 3G in iOS 8 but keep the cellular data connection for receiving emails, go on the internet, etc? 3G coverage here is patchy so I expect either poor connectivity an

  • IPhone 4 bumper dimensions?

    Apple doesn't post the dimensions of their bumper "case" on their web site. I'd like to know the dimensions so I can check for compatibility with my existing iPhone 3G car mount. Anyone have this information? Thanks! Mike

  • AIR Application Launching problem

    Hi All, I created one AIR application using Flash CS3. The air file size is 350+ MB. This air file included swf and flvs. I installed successfully but the problem is when i try to launch the application It takes time. How can i solve this? Any one he